users@jersey.java.net

[Jersey] Re: Servlet 3.0 Container Deployment

From: Sathyakumar <sathyakumar.s_at_gmail.com>
Date: Sat, 28 Jun 2014 00:44:22 +0530

Just an aside - Which Jersey library (jar file) contains web-fragment.xml,
I just cannot locate it. I somehow suspect thats the reason the war file
wont deploy properly in tomcat or Jetty. And somehow Glassfish has the
required jar file in its classpath


On Sat, Jun 28, 2014 at 12:33 AM, Sathyakumar <sathyakumar.s_at_gmail.com>
wrote:

> Here you go - I just created a new simple maven project to explain the
> issue. Note that there are no servlet filters. Just following instructions
> in Jersey documentation on descriptor-less deployment. Note that war file
> just deploys and *works *Glassfish, but does not work in Tomcat 7.
>
> Really appreciate your help looking in to this.
>
>
> On Sat, Jun 28, 2014 at 12:09 AM, Saad Mufti <saad.mufti_at_gmail.com> wrote:
>
>> The WebListener part is specific to our application, it is not really
>> required. You can initialize everything in your Application class that
>> extends ResourceConfig if that suits you. We were integrating with some
>> frameworks that for complicated reasons required initializing in a
>> ServletContextListener.
>>
>> Similarly servlet filters are again sepcific to our app, you can use
>> Jersey server side filters if that meets your needs and then there is even
>> less that is servlet specific.
>>
>> Yeah sure if you send me a stripped down structure of your app I can take
>> a quick look to see if anything jumps out.
>>
>> Cheers.
>>
>> ----
>> Saad
>>
>>
>>
>> On Fri, Jun 27, 2014 at 1:07 PM, Sathyakumar <sathyakumar.s_at_gmail.com>
>> wrote:
>>
>>> 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.
>>>>>
>>>>
>>>>
>>>
>>
>