• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ejb client code error during lookup-websphere  RSS feed

 
sathish kumar d
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi techies,
This is my first question in this forum. Iam new to websphere app server. I have a stateless ejb deployed in websphere V3.5, when i run my client code i get the following error
Error :-
javax.naming.NamingException: Error during resolve. Root exception is java.lang.NullPointerExcepti
on
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:726)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:584)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at HelloClient.main(HelloClient.java:18)
------------------
My client code :-
Hashtable p=new Hashtable();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
p.put(Context.PROVIDER_URL,"iiop://localhost:900");
InitialContext ctx = new InitialContext(p);
Object look=ctx.lookup("HelloJndi");
Stateless.HelloHome home=(Stateless.HelloHome)javax.rmi.PortableRemoteObject.narrow(look,Stateless.HelloHome.class);
Stateless.Hello remote=home.create();
String msg=remote.sayHello(args[0]);
System.out.println("Output...."+msg);
-----------------
Thanx in advance,
sathish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!