users@jersey.java.net

[Jersey] Re: Servlet 3.0 Container Deployment

From: Saad Mufti <saad.mufti_at_gmail.com>
Date: Fri, 27 Jun 2014 12:23:36 -0400

It works fine for me and my team. Without more details, it would be hard to
figure out the specific reason why yours doesn't.

We're using Jersey 2.6 and Tomcat 7.0.54, with no web.xml, just
@ApplicationPath and @WebListener. One wrinkle, for servlet filters we
couldn't use annotations as order is not possible to specify, so at one
point we had a tiny web.xml to enforce filter order, but Tomcat didn't seem
to always respect that, so now we register our servlet filters
programmatically in a ServletContextListener annotated with @WebListener.

Cheers.

----
Saad
On Fri, Jun 27, 2014 at 12:05 PM, Sathyakumar <sathyakumar.s_at_gmail.com>
wrote:
> Am trying to deploy a war file without a web.xml (with an Application
> subclass annotated with @ApplicationPath). While this war files works in
> Glassfish server, the same is not working in Tomcat 7.
>
> I understand Jersey through web fragments creates a default
> JerseyContainerServlet. I have browsed through the entire source code of
> Jersey to locate web-fragment.xml, but could not find it. Could this be the
> reason why it wont work in Tomcat (but somehow does in Glassfish)? Am I
> missing any jar file in the war ?
>
> Any help will be appreciated.
>