Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javax.naming.NameNotFoundException: Name comp/env/ejb not found in context

843830Jan 19 2005 — edited Oct 26 2006
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2006
Added on Jan 19 2005
23 comments
6,088 views