Giving JMS a first shot, when I try to inject @Resource(lookup="jms/ConnectionFactory")
, I get the error:
The attribute lookup is undefined for the annotation type Resource
I just read How to use java ee 6 @Resource annotation, but I haven't study Maven yet, so I was wondering, if I can fix this issue some other way rather than using Maven?
I'm using Eclipse by the way.
The right fix for this is to right-click your project in Eclipse, Java Build Path -> Order and Exports, select JRE System Library and click on Bottom.
Try using the mappedName attribute as:
@Resource(mappedName="jms/ConnectionFactory")
Also if you still want to use lookup, then take a look at the javax.annotation.jar you are using. Lookup attribute was introduced in JavaEE 6. Probably you have an older version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With