On Apr 22, 2010, at 1:29 PM, ljnelson wrote:
> On Thu, Apr 22, 2010 at 5:48 AM, Paul Sandoz [via Jersey]
> <[hidden email]> wrote:
> > 2.3.2 Servlet
> >
> > A JAX-RSĀ application is packaged as a Web application in a .war
> file. The
> > application classes are packaged in WEB-INF/classes or WEB-INF/lib
> and
> > required libraries are packaged in WEB-INF/lib. See the Servlet
> > specification for full details on packaging of web applications.
> >
> > The above is only referring to a servlet and not in general to an
> EE 6
> > container.
>
> Sure. I just wanted to make sure that even though the specification
> says that resource classes must be present in WEB-INF/classes or
> WEB-INF/lib, it is actually wrong--such classes may also be present in
> an enclosing ear file's lib directory.
>
That section is not wrong, it is only referring to servlet and not to
EE 6. JAX-RS 1.0 did not define any integration with EE.
I think the spec could have clarified things better in the EE 6 section:
https://jsr311.dev.java.net/nonav/releases/1.1/spec/
spec3.html#x3-630006.2
Basically what you want to do should i think work.
The key thing is JAX-RS does require a war (unlike IIRC JAX-WS) to
hook things up.
The Jersey servlet that is instantiated needs access to the resource
and provider classes such that those classes can be analyzed and
instantiated (either by Jersey or by the container depending on how
those classes are managed). So the rules are really governed by class
loading visibility from the servlet associated with a war to other
archives, and i am not familiar with the exact rules.
Paul.