This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, has anyone tried an EJB injection through the @EJB annotation using JBOSS CR1 ? I read everywhere that it's bugged, I have not tried yet but would like to know if JBoss fixed that or not in the latest version of JBoss.
I've used JBoss 4.x for my preparation and it works very well.
In JBoss-4.2.x, the @EJB injection does not work in servlets. It works only in EJBs. JBoss-5 (which is still in a CR version) is a JavaEE5 server and the @EJB injection in servlets is going to work in JBoss-5 versions.
Are you sure? EJB Injection to a servlet in jboss 4.x is working?
Joined: May 17, 2006
Hi Mirko Bonasorte,
Other thing to point out is I dont see any wrong with this post (parent), Why did you ask thread owner to post this problem in other forum? Do you think container is not related to this forum? Do you think we can practice without a container?
has anyone tried an EJB injection through the @EJB annotation using JBOSS RC1 ? I read everywhere that it's bugged, I have not tried yet but would like to know if JBoss fixed that or not in the latest version of JBoss.
With JBoss-5.0 CR1, the @EJB injection works for both within servlets (read further) and within other EJBs. However, within servlets, there's a bug which mandates that you use the mappedName attribute with @EJB while injecting. Something like this: