• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

@EJB annotation Injection

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

can we inject the Session bean into POJO using @EJB annotation?
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Provided the POJO is deployed in EJB server and has EJB classes packages in same jar containing the POJO. Yes, EJB injection into a POJO is possible via Application Client Container(ACC) provided by the EJB server. Not all EJB servers support ACC. But GlassFish and JBoss serevrs provide ACC.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

lalit upadheyay wrote:Provided the POJO is deployed in EJB server and has EJB classes packages in same jar containing the POJO. Yes, EJB injection into a POJO is possible via Application Client Container(ACC) provided by the EJB server. Not all EJB servers support ACC.



I think i'll disagree with that Application client containers only help with injecting resources like EJB only within the class having the main method (i.e. the class which acts as the starting point of the application).
 
reply
    Bookmark Topic Watch Topic
  • New Topic