users@jersey.java.net

[Jersey] Re: Servlet 3.0 Container Deployment

From: Sathyakumar <sathyakumar.s_at_gmail.com>
Date: Fri, 27 Jun 2014 22:37:58 +0530

It is really simplest possible deployment for me. I run Jersey 2.9 and
Tomcat 7.0.54. I have almost web.xml (just the web-app tag) and have an
Application subclass annotated with @ApplicationPath. I can strip this code
down and send the barebone war file if it makes sense.

One question I have - why @WebListener. I assumed it was necessary (and in
fact GlassFish deployment didnt require it).
I am just following instructions here -
https://jersey.java.net/documentation/latest/deployment.html#deployment.servlet.3
under section 4.7.2.1. Descriptor-less deployment,



On Fri, Jun 27, 2014 at 9:53 PM, Saad Mufti <saad.mufti_at_gmail.com> wrote:

> 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.
>>
>
>