Hi all,
I've been using mvn jetty:run to test a web app - using Servlet API
2.5 - that has a servlet that makes use of @Resource annotation:
public class HealthCheckServlet extends HttpServlet {
@Resource(name = "java:comp/env/jdbc/ottodb")
private DataSource ottoDbDs;
//...
}
The web.xml file is configured to enable annotation processing by
setting the attribute metadata-complete="false" on the <web-app> tag,
and the JNDI setup is correct (a direct lookup to
"java:comp/env/jdbc/ottodb" via InitialContext works fine.)
When I'm debugging this servlet, however, I noticed that the data
source is not being injected as expected (i.e. the ottoDbDs field is
null).
According to jetty documentation
(http://docs.codehaus.org/display/JETTY/Annotations), it's necessary
to add some configuration to allow @Resorce annotation processing. I'm
now wondering if this is enabled by default when using mvn jetty:run.
If not, what should I do to enable it?
Thanks!
Mauricio
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email