-
1. Re: making EJB local references from two diffrent EARs
adrian.brock Apr 16, 2003 7:15 AM (in response to cvulpe)Outside of an ear you have to lookup into
global jndi.
By default the bean is at local/<ejb-name>
Remote is optimized to local in the same
jboss server.
Regards,
Adrian -
2. Re: making EJB local references from two diffrent EARs
cvulpe Apr 16, 2003 8:36 AM (in response to cvulpe)Hi!
I still have a few questions:
1) The procedure you propose is a portable one over different EJB servers?
2) Are there necessary any extra-settings into the deployment descriptors?
3) If I have a bean whose JNDI name is "MyBean", can you give me a short example of the lookup code line?
Thanks again,
cristi -
3. Re: making EJB local references from two diffrent EARs
adrian.brock Apr 16, 2003 9:45 AM (in response to cvulpe)No this is not portable.
The j2ee spec does not include a mechanism
for local references outside the application (ear)
The example code is
InitialContext ctx = new InitialContext();
MyLocalHome home = (MyLocalHome) ctx.lookup("local/MyEJBName");
I think most application servers let you redefine
the global local jndi name
e.g. in jboss.xml
<ejb-name>whatever</ejb-name>
<local-jndi-name>ejbs/local/whatever</local-jndi-name>
...
Regards,
Adrian