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!

ejb test client problem with context and lookup

843830Feb 23 2006 — edited Feb 24 2006
What can i do in this situation? (I use Sun Application Server 8.1) :
In this piece of code in a ejb test client:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "iiop://127.0.0.1:4700");
 //get naming context
Context context = new InitialContext(env);
 //look up jndi name
 Object ref = context.lookup("JNDIName");
I have an error in a lookup, and i tried ejb/JNDIName, java:comp/env/ejb/JNDIName but ... the error is in all situations:

javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]

at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)

at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)

at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)-- Failed initializing bean access.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2006
Added on Feb 23 2006
10 comments
449 views