One interesting point is the different "id" for the two class-objects (926 vs. 23818). Could this be the reason for the issue? Am I having a class-loading-problem or something releated?
There is another weird thing to mention: the annotation @Resource is located within two jars:
- rt.jar from the Java Runtime
Both classes have the same package-name (javax.annotation), but the jboss-class contains 1 more method (String lookup()). Could this cause the exceptions I'm currently facing? If yes, how am I supposed to force the usage of the correct class (whichever it may be)?
Another information: in contrast to the not working @Resource-injection, the injection of EJBs using @EJB works absolutely fine.
Thanks in advance.
Is there anybody who's got my scenario (@Resource injection into a JSF managed bean) working with JBoss 6.0 or 6.1?
Are you packaging any jar file(s) containing javax.annotation.* classes within your application? If yes, remove such jar file(s) from the application packaging.
OMG... now I feel somewhat ashamed... I actually did package common-annotation.jar with my application. I couldn't remember but always thought I was just packaging richfaces-jar files. As the jar's where NOT added to the project's buildpath I didn't locate them in eclipse when looking for jar files exposing the javax.annotation.Resource class.
Thank you very much jaikiran, I really appreciate your help!