users@glassfish.java.net

JAX-RS and CDI integration using Glassfish v3

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 Jan 2010 14:01:31 PST

In order to deploy a JAX-RS endpoint (ie: @javax.ws.rs.Path), I seem to have to configure the Jersey servlet in web.xml (com.sun.jersey.spi.container.servlet.ServletContainer, and parameter, com.sun.jersey.config.property.packages). This works well, but is there a more portable JEE6 way?

Another annoying side-effect of having to do this is that the Jersey servlet bootstrapper does not perform CDI injections on the endpoint.

However, if I mark the endpoint with @javax.annotation.ManagedBean, then CDI injections work fine. However, shouldn't @javax.ws.rs.Path be enough to enable CDI injections? Am I missing something in the JEE6 spec?

Thanks.
[Message sent by forum member 'jeremynorris' (jnorris_at_pattern73.com)]

http://forums.java.net/jive/thread.jspa?messageID=382037