This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes The only time a lookup is  needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "The only time a lookup is  needed" Watch "The only time a lookup is  needed" New topic
Author

The only time a lookup is needed

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 763
On Frits' notes, p.63,

7.1 @EJB - injecting an EJB
The only time a lookup is needed is when the @EJB and @Resource is declared on the bean class.


I believe a lookup is also needed when an EJB is injected, like this example on p.66:

Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1686
    
  25

What I meant by that remark is that the lookup is not needed in line number 9.

The following code would be sufficient:

Although the code above doesn't look like it has a lookup of the EJB it certainly does a lookup because "Each injection of an object corresponds to a JNDI lookup" (page 63)

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The only time a lookup is needed