Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

J2EE Client not able to look up EJB

Posts: 4
  • Mark post as helpful
  • send pies
  • 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 at at at at javax.naming.InitialContext.lookup( at com.fifththird.ebusiness.csoo.dataload.InvokeFederalLoad.main( at java.lang.reflect.Method.invoke(Native Method) at at at java.lang.reflect.Method.invoke(Native Method) at

Please let me know how the problem can be resolved?
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • 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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JNDI name is correct except that it should not start with a slash.
I changed that to "ejb/" and it worked. :-))
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic