This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Referencing session beans from helper classes / JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Referencing session beans from helper classes / JNDI" Watch "Referencing session beans from helper classes / JNDI" New topic
Author

Referencing session beans from helper classes / JNDI

Tapio Niemela
Ranch Hand

Joined: Jan 06, 2006
Posts: 77
Hi fellow ranchers. I don't seem to get the example in the EJB3 In Action on pages 442-443. The example is about "Referencing session beans from Helper classes". The book suggests following situation: ActionBazaarBidControllerServlet calls unmanaged BidProcessor, which in turns uses session bean PlaceBid. In the example ActionBazaarBidControllerServlet is annotated with @EJB at the class level and PlaceBid is searched in BidProcessor using context.lookup. I assume this is JNDI lookup (not SessionContext). But I'm puzzled; can't I anyhow lookup the JNDI resource myself on the BidProcessor-class without annotating the "entry-point" ActionBazaarBidControllerServlet? Or does that annotation somehow "enable" EJB-specific JNDI-lookups?

Thanks for answers in advance
 
jQuery in Action, 2nd edition
 
subject: Referencing session beans from helper classes / JNDI