• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

J2EE Client not able to look up EJB

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My J2EE client is running in WSAD 5.0.0. My EJB is deployed on Websphere 5.0 Test Server in WSAD.

Here is the snippet of my code:
InitialContext context = new InitialContext(); Object objref = context.lookup("/ejb/com/fifththird/ebusiness/csoo/dataload/ejb/DataLoadServiceHome"); Object obj = PortableRemoteObject.narrow(objref, DataLoadServiceHome.class); DataLoadServiceHome home = (DataLoadServiceHome) obj; DataLoadService dataLoadService = home.create(); dataLoadService.loadFederalNoCall();

The exception is: javax.naming.NameNotFoundException: /ejb/com/fifththird/ebusiness/csoo/dataload/ejb/DataLoadServiceHome at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1503) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1457) at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1167) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132) at javax.naming.InitialContext.lookup(InitialContext.java:359) at com.fifththird.ebusiness.csoo.dataload.InvokeFederalLoad.main(InvokeFederalLoad.java:65) at java.lang.reflect.Method.invoke(Native Method) at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:616) at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:420) at java.lang.reflect.Method.invoke(Native Method) at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)

Please let me know how the problem can be resolved?
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should lookup for the jndi-name of your ejb.
I don`t thing that this is your ejb jndi`s name.



Is it???

Usually, jndi names are somthing like this.


In the above example, the jndi name is DataLoadServiceBean.
 
Suma C S
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JNDI name is correct except that it should not start with a slash.
I changed that to "ejb/com.fi...." and it worked. :-))
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic