-
1. Re: Get configurable remote EJB reference from another jboss6 instance
jaikiran Oct 26, 2011 12:02 AM (in response to mrshadow)So you want to override the @EJB mappedName via a xml? You can do that via a ejb-ref element in the jboss.xml.
Something like:
@EJB(name="matchingNameInEJBRefInXml", mappedName="localJndiName")
RemoteBean myRemoteBean;
<ejb-ref>
<ejb-ref-name>matchingNameInEJBRefInXml</ejb-ref-name>
<jndi-name>TheJNPRemoteJNDIName</jndi-name>
....
</ejb-ref>
-
2. Re: Get configurable remote EJB reference from another jboss6 instance
mrshadow Oct 26, 2011 4:58 AM (in response to jaikiran)Many thanks for your help !
Since I already tried this, that's I was doing something wrong... So I double check according to your response, and it's working fine ( in jboss.xml, the <ejb-name> was mapped on the Interface... arg !)
The 'problem' with this solution (override annotation with xml) is I have to write a jboss.xml conf for each local bean, even if I am injecting the same remote EJB
Is there any way to get the remote ejb referenced in the local JNDI tree with some kind of XML conf ? So I could inject this local ref without having to override annotation
In each local ejb (without having to write an '<session><ejb-ref>...' per local bean) :
@EJB(mappedName="localJndiNameOfRemoteBean")
And a JNDIView with something like this :
+ localJndiNameOfRemoteBean
+ jnp://host2:1099/...../RemoteBean
(If this is not possible, i'll code my own local proxy to do this...)