File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Referencing session beans from helper classes / JNDI
 
Similar Threads
can EJB 2.1 call EJB 3.0 ?
Doubt on DI
Jboss and Ejb 2.1 ejb-ref lookup
How to invoke an EJB3 from a simple client
EJB application deployment problem