users@glassfish.java.net

Re: GF 3.1.1: Jersey based RESTful WebServices

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 28 Feb 2012 18:05:57 +0100

Hello Bernhard,

do you have Jersey jars packed into deployed war file? If you do, please
remove them and try again.

If not, can you please share minimal testcase which will reproducible
this issue?

And BTW, we have users_at_jersey.java.net mailing list for Jersey related
questions.

Thanks,
Pavel

On 2/28/12 5:38 PM, Bernhard Thalmayr wrote:
> Hi experts,
>
> I have a web-app which includes RESTful WebServices based on Jersey.
>
> When I deploy the application within GF 3.1.1 I get the following exception ...
>
>
> [#|2012-02-28T15:52:52.759+0100|INFO|glassfish3.1.1|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=208;_ThreadName=Thread-2;|Initiating
> Jersey application, version 'Jersey: 1.8 06/24/2011 12:17 PM'|#]
>
> [#|2012-02-28T15:52:52.808+0100|INFO|glassfish3.1.1|com.sun.jersey.server.impl.application.DeferredResourceConfig|_ThreadID=208;_ThreadName=Thread-2;|Instantiated
> the Application class com.sun.identity.rest.RestService|#]
>
> [#|2012-02-28T15:52:53.052+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web._vs.server|_ThreadID=208;_ThreadName=Thread-19;|WebModule[/opensso]StandardWrapper.Throwable
> java.lang.NoClassDefFoundError: Could not initialize class
> com.sun.jersey.core.header.MediaTypes
> at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:182)
> at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
> at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
> at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1277)
>
> I checked out Jersey 1.8 code from svn and this class is there ....
>
> The Web Services is deployed as described in
> 'http://docs.oracle.com/cd/E19776-01/820-4867/ggnxs/index.html'.
>
>
> Entry in web.xml
>
> <servlet>
> <servlet-name>ws</servlet-name>
> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
> <init-param>
> <param-name>javax.ws.rs.Application</param-name>
> <param-value>com.sun.identity.rest.RestService</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> What might cause this or where do I have to look at?
>
> TIA,
> Bernhard
>