Hi I am trying to write a hello world
test client in am using RAD 6.0 and WAS 5.1 test environment. I have created and deployed a simple session bean but have problems accessing it using a test client.
Following is the code I use;
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:2809");
//Properties props = System.getProperties();
Context ctx = new InitialContext(env);
Object obj = ctx.lookup("HelloHome");
HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj, HelloHome.class);
Hello hello = home.create();
and it throws the following error;
Exception in
thread "P=485337
=0:CT" javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: HelloHome: First component in name HelloHome not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL
mg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:85)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1067)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at HelloTestClient.main(HelloTestClient.java:29)
Can some one help debug the problem.
Thanks,
Ram