On Aug 26, 2009, at 3:23 AM, Rodger wrote:
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.
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");
Who can help me?
This is just a guess :-)
You need to tell geronimo something to indicate that you want the ejb available in the java:comp/env jndi namespace. This can be either the annotation you show first or an ejb-ref element in the xml deployment descriptor for your app. If you have removed the annotation and forgotten to add the ejb-ref element you will not be able to look up the ejb in java:comp/env.
maybe its a lucky guess :-)
Geronimo version 2.2