Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to Find EJB in JNDI

 
Russ Ray
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Morning to All!

I have been scratching my head all day yesterday trying to understand this error:

[2005-06-15 09:44:38,203][Servlet.Engine.Transports : 1][FATAL][{ServiceLocator}{getHome}{CONFIG0001}{Failed to find EJB Reference from JNDI tree}{External Message:Name comp/env/ejb not found in context "java:".}]
{ServiceLocator}{getHome}{CONFIG0001}{Failed to find EJB Reference from JNDI tree}{External Message:Name comp/env/ejb not found in context "java:".}


What is going on is the user is logging into the web application. The process is the user comes in from the web container and enters the EJB container through the AdminEJB. The AdminEJB has a reference to a singleton POJO entitled ServiceLocator. This POJO follows the locator pattern. One of the things the Locator is attempting to accomplish is retrieving the CacheEJBLocalHome. This Cache ejb has a JNDI name of
ejb/CacheEJBHome
I have promoted the Cache ejb to the Local and the Remote interfaces using WSAD.

I realize the lookup method can not find the EJB, but I do not know what is causing this behavior. I originally thought the AdminEJB needed a bean reference to the CacheEJB, but this did not work.

Any insight or debugging techniques into this issue would be greatly appreciated.

Thank you for reading my post.

Russ
 
Milind V. Kulkarni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check whether EJB is properly deployed or not. This kind of error is encountered only when EJB is not deployed correctly.

Regards,
Milind
 
Aravind Kumar
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
comp/env/ejb is private environment for AdminEJB...the actual JNDI location should be java:/ejb/CacheHomeEJB
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The recommended ejb context of the bean�s environment is java:comp/env/ejb. So, you would expect the home interface to be found by looking up the JNDI tree for "java:comp/env/ejb/CacheHomeEJB".

The recommended subcontexts of the bean's environment for other resource manager connection factory references are:
java:comp/env/service (web service)
java:comp/env/jdbc (JDBC)
java:comp/env/jms (JMS)
java:comp/env/mail (JavaMail)
java:comp/env/url (URL)
 
vv sreeram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I am getting a similar error. I have added an BMP entity bean to an existing application. When i try to look up the bean i am getting the following error

javax.naming.NameNotFoundException: Name "ejb/DMT/NpSpeedMaintHome" not found in context "local:".
Should i set the context somewhere so that this bean is in the local context ??

Thank You
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic