Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

The only time a lookup is needed

 
Ranch Hand
Posts: 1791
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Creator of Enthuware JWS+ V6
Posts: 3315
298
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

 
Evil is afoot. But this tiny ad is just an ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!