JavaEE 6: Can't compile @Resource(lookup="")
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开发者_StackOverflow中文版.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
?
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.
精彩评论