-
1. Re: Newbie EJB 3 JNDI question
itsme Dec 11, 2007 7:31 PM (in response to deanouk)On the server side a lookup is'nt needed anymore. Just annotate a member field of the interface type of the necessary ejb like:
... @EJB private MyBeanLocal bean; ...
\sandor\ -
2. Re: Newbie EJB 3 JNDI question
deanouk Dec 12, 2007 2:27 AM (in response to deanouk)Yes, but is this then retrieved from the local ENC?
How is it in the local ENC? -
3. Re: Newbie EJB 3 JNDI question
gquintana Dec 12, 2007 3:32 AM (in response to deanouk)I don't (not sure yet) think "java:comp/env" local context is still used with EJB3.
-
4. Re: Newbie EJB 3 JNDI question
itsme Dec 12, 2007 4:04 AM (in response to deanouk)Yes, but is this then retrieved from the local ENC?
Yes, its the app servers responsibility to resolve the injectected resource from the local enc as long as MyBeanLocal is annotated with @Local (or at least MyBean with @Local({MyBeanLocal.class}).
Regards
\sandor\ -
5. Re: Newbie EJB 3 JNDI question
deanouk Dec 13, 2007 10:24 AM (in response to deanouk)Ok so I do this, and all I see is a list of global JNDI names in the JMX Console.
There are no local references under each of the EJBs to the local ENC EJB references - they're all global!
So there *must* be another way of doing this so that we inject into the local ENC? -
6. Re: Newbie EJB 3 JNDI question
waynebaylor Dec 26, 2007 3:47 PM (in response to deanouk)the jmx-console doesn't display the contents of local ENCs for EJBs. it will display a WAR's ENC... Anyway, it doesn't matter how the app. server injects the bean. entries in the ENC are just "local" names for the EJBs' global JNDI names.
-
7. Re: Newbie EJB 3 JNDI question
alrubinger Dec 26, 2007 6:53 PM (in response to deanouk)"wanebaylor" wrote:
the jmx-console doesn't display the contents of local ENCs for EJBs
JNDIView bundled with the 5.x series does / will."gquintana" wrote:
I don't (not sure yet) think "java:comp/env" local context is still used with EJB3.
When @EJB is defined on EJB A to EJB B, EJB A's local ENC will contain an entry to resolve the dependency. This may be looked up via traditional JNDI (using the java:comp/env namespace, ejbContext.lookup() (without the prefix to the namespace), or via injection.
S,
ALR