javax.annotation.Resource class in JDK is older version that doesn't have lookup(). You will need to put javax.annotation.jar from Java EE 6 (or GlassFish 3.x) before rt.jar in NetBeans to override. Outside IDE, use endorsed mechanism for overriding.
[Message sent by forum member 'cf126330']
http://forums.java.net/jive/thread.jspa?messageID=484765