• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Ejb client code error during lookup-websphere

 
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
 
rubbery bacon. rubbery tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!