javax.naming.NameNotFoundException: Name comp/env/ejb not found in context
843830Jan 19 2005 — edited Oct 26 2006Hi folks!
I am trying to instantiate a Session bean local interface from a servlet:
this is the usual call
Context ctx = new InitialContext();
MessageHandlerLocalHome localhome = (MessageHandlerLocalHome)ctx.lookup("java:comp/env/ejb/it/eds/cm/ejb/session/interfaces/MessageHandlerHome");
System.out.println("[RetrieveServlet]### Lookup riuscito");
MessageHandlerLocal C = localhome.create();
on WSAD 5.1 I get this error
javax.naming.NameNotFoundException: Name comp/env/ejb not found in context "java:".
6b766c9d SystemErr R at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1638)
[19/012 CET] 6b766c9d SystemErr R at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:997)
[19312 CET] 6b766c9d SystemErr R at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:920)
[19.47:312 CET] 6b766c9d SystemErr R at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1211)
[19CET] 6b766c9d SystemErr R
Did I forget any reference?...No! Because if I export the project and deploy it on WAS 5 it works perfectly.
Can you help?
I think that IBM's products are like Microsoft ones...
Bye
GC