wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes @EJB injection with JBoss 5 CR1: working or not ? 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 injection with JBoss 5 CR1: working or not ?" Watch "@EJB injection with JBoss 5 CR1: working or not ?" New topic
Author

@EJB injection with JBoss 5 CR1: working or not ?

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

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.

Thanks.
[ August 21, 2008: Message edited by: Celinio Fernandes ]

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Mirko Bonasorte
Ranch Hand

Joined: May 14, 2007
Posts: 244
I'm afraid you are off topic here.
Try at 'EJB and Other Java EE Technologies' forum or 'JBoss' forum.
Anyway, I've used JBoss 4.x for my preparation and it works very well.


SCJP<br />SCWCD 1.4 Upgrade (Remember: me stupid)<br />SCWCD 1.4<br /><a href="http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html" target="_blank" rel="nofollow">SCBCD 5.0</a><br /><a href="http://www.enthuware.com" target="_blank" rel="nofollow">SCBCD 5.0 mock exam</a> <br /> <br />SCEA 5 Part1: Preparing...
Garlapati Ravi
Ranch Hand

Joined: Mar 05, 2008
Posts: 168
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.

for more info, please check my previous post, not exactly regarding this problem, but this has been covered
http://www.coderanch.com/t/163959/java-EJB-SCBCD/certification/EJB-application-deployment
[ August 19, 2008: Message edited by: Garla Ravi ]

Ravi Kumar
SCWCD 5 - 89%, SCJP 1.4 - 90%
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
Hi Mirko Bonasorte,

Are you sure? EJB Injection to a servlet in jboss 4.x is working?
Chaminda Amarasinghe
Ranch Hand

Joined: May 17, 2006
Posts: 402
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?

Thanks
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9960
    
163


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:



[My Blog] [JavaRanch Journal]
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Jaikiran Pai, that's interesting.
where did you get that info ?
I will try that soon.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9960
    
163

Originally posted by Celinio Fernandes:
Jaikiran Pai, that's interesting.
where did you get that info ?


From here
 
Consider Paul's rocket mass heater.
 
subject: @EJB injection with JBoss 5 CR1: working or not ?
 
Similar Threads
JBoss 5 and EJB 3 Webservices
upgrading JBOSS 5 CR1 with JSF 2.0.1
Whether the jboss support
Injecting EJB into servlet
number of session beans in the pool, timeout etc for EJB