JavaEE 6: Can't compile @Resource(lookup=“”)
-
22-01-2021 - |
Question
I am trying to use @Resource(lookup="")
to look up a resource configured in Glassfish 3.1. I am using Eclipse 3.5.
I've set -Djava.endorsed.dirs=${GLASSFISH_HOME}/modules/endorsed
and added javax.annotation.jar
to my projects build bath but still it doesn't compile.
I am not able to see the lookup parameter with @Resource
.
Could someone help me understand why am I not getting the lookup parameter with @Resource
?
Solution
Are you sure the javax.annotation.jar
that you are using is the one for JavaEE6 (and not for a prior version), since lookup
was introduced in JavaEE 6. Check the MANIFEST of that jar to confirm.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow