Then you have to use InitialContext # lookup("java:/comp/env/_Resource_Id_In_your_web_Xml").
As we said, if you want to inject dependencies to your classes, those classes must be known by the container. --Gurkan ________________________________ From: marble4u <marco.blev...@energy4u.org> To: users@tomcat.apache.org Sent: Thu, June 17, 2010 6:37:56 PM Subject: Re: Resource Annotation has no effect but JNDI Lookup works (JDBC Resource) @gurkan & Chris: actually I don't want to use the resource directly in a servlet or JSP - due to architectural reasons - so is there a way to inject resources into plain java classes? @Pid: Thanks for the Information. I will check out the spec and hope that it is not too much to read ;-) And thanks a again for all the hints -- View this message in context: http://old.nabble.com/Resource-Annotation-has-no-effect-but-JNDI-Lookup-works-%28JDBC-Resource%29-tp28900220p28916019.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org