Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 9955
    
163

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: @EJB annotation Injection
 
Similar Threads
Annotation inheritence limitations
@Startup annotation
One of more persistence context for separate projects?
Difference between @inject and @Resource
difference between annotations