• 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Websphere Naming Exception

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am new to WSAD 4.0 . I am trying to look for Seesion Bean using JNDI name.

This is my code.

ctx = new InitialContext();
Object home = ctx.lookup("LoadClassBean");
loadhome = (LoadClassBeanHome)javax.rmi.PortableRemoteObject.narrow(home, LoadClassBeanHome.class);
LoadClassBean beanremote = loadhome.create();

I am getting exception.

javax.naming.NameNotFoundException: LoadClassBean
at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:1435)
at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:1115)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at LoadServlet.doGet(LoadServlet.java:25)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService

Can anyone suggest why i am getting exception and how to set JNDI name in WSAD.

THankx
 
author & internet detective
Posts: 39343
755
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roopam,
It's not "ejb/SessionBeanName" for the JNDI name? Anyway, this is set on the bean tab of the ejb deployment descriptor. What kind of client are you using? You may need to set up an ejb reference.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!