geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: A question about jndi
Date Fri, 28 Aug 2009 21:08:32 GMT

On Aug 26, 2009, at 3:23 AM, Rodger wrote:

> Hi,
> I have a remote interface my.test.Echo and a ejb my.test.EchoBean.
> I don't do any configuration for the jndi in deployment descriptor  
> and deployment plan.
> Then using
> @EJB(name="my/test/Echo")
> private Echo echo;
> can find the ejb and run successfully.
> But why using
> Context ctx = new InitialContext();
> Echo echo = (Echo)ctx.lookup("java:comp/env/my/test/Echo");
> there is:
> javax.naming.NotContextException: my/test/Echo
It isn't widely known but the annotation does create deployment  
descriptor data.  I'm guessing that when you try the second approach,  
you are removing the annotation and therefore removing the reference  
from JNDI.

Here is a doc which shows an annotated approach and what those  
annotations would look like in xml:

Hope this helps.


View raw message