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

Referencing session beans from helper classes / JNDI  RSS feed

Tapio Niemela
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!