Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with JNDI name of EJB  RSS feed

 
Nichole Kim
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to look up a session bean which is in an EJB project. The calling client and the EJB project are both on my local server.I am using WSAD 5.0. I used JNDI name "java:comp/env/ejb/<EJBName>", it throws NameNotFoundException, I tried "ejb/<EJBName>", still throws NameNotFoundException. The exact jndi name in its ejb-jar.xml is "ejb/<EJBName>". What could go wrong? Anybody can help me out?
Thanks millions!
Nichole :
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJB reference "java:comp/env/ejb/<EJBNAME>" will only work if you include an EJB reference to "ejb/<EJBNAME>" in your client's deployment descriptor (web.xml if it's a servlet client, application-client.xml, if it's an application client).
On the other hand, directly looking up "ejb/<EJBNAME>" should work in any case. (Although you should use EJB references instead of direct name lookups wherever possible). If you're not finding the EJB by using it's base JNDI name, then odds are quite good that the EJB did not start. Look in the console and make sure that both the EJB JAR and the EJB itself started successfully and that there were no errors.
Kyle
 
Nichole Kim
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, yeah, the EJB project did not start correctly. It has some errors. I will fix it and try again. Thank you so much!
Nichole
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are very welcome. Let us know if you have any more problems we can help with.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!