This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @EJB annotation Injection 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 "@EJB annotation Injection" Watch "@EJB annotation Injection" New topic
Author

@EJB annotation Injection

Amit Suresh Pawar
Ranch Hand

Joined: Dec 09, 2008
Posts: 30
Hi,

can we inject the Session bean into POJO using @EJB annotation?


Amit S. Pawar
SCJP,SCWCD,OCA
lalit upadheyay
Ranch Hand

Joined: Jun 20, 2005
Posts: 110
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.


SCJP1.4, SCWCD1.4, SCBCD5.0(working on...)
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10441
    
176

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).


[My Blog] [JavaRanch Journal]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: @EJB annotation Injection
 
It's not a secret anymore!