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

LocalEJB lookup  RSS feed

 
Prannav Santhosh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to EJB and i have a question on looking up the local ejb.

I have a local EJB bean deployed in my RSA which is associated with a JNDI name "ejb/com/ThirdBeanLocalHome" and i am accessing the EJB from a servlet ( as part of the same EAR).

Scenario (1) -- > when i use the direct JNID name from my servlet , the look up is failing
InitialContext con = new InitialContext();
ThirdBeanLocalHome homeInt = (ThirdBeanLocalHome)con.lookup("ejb/com/ThirdBeanLocalHome");

Scenario (2) -> when i declare a refernce in the web.xml , i am able to lookup the localhome from my servlet.

Does any one know why the scenario(1) fails ?

Thanks!!
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36396
453
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prannav,
That implies something is different between the reference and scenario 1.

Is there any reason scenario 1 isn't using java:comp/env/ejb/com/ThirdBeanLocalHome?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!