This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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
Marshal
Posts: 37180
515
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!