users@glassfish.java.net

Re: GF 3.1.1: Jersey based RESTful WebServices

From: Bernhard Thalmayr <bernhard.thalmayr_at_painstakingminds.com>
Date: Tue, 28 Feb 2012 18:26:11 +0100

Thanks for your attention Pavel.

I've already subscribed to jersey alias, however I'm not sure if it's
Jersey or GF related.

Initially there has been a Jersey jar packaged, but I already removed it.

Only Hot-Deployment showed this error, when restarting the server (which
reloads the app as well) I do not see this error ?!?

OpenSSO uses a jvm-wide singleton ... which has already been created by
a different peace (OpenSSO policy agent) ... might this be related
although not shown in the stacktrace?

When restarting the server this singleton is not initialized as the
servlet-filter (which initializes the singleton) is not triggered.

Regards,
Bernhard

Am 2/28/12 6:05 PM, schrieb Pavel Bucek:
> 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
>>
>
>


-- 
Painstaking Minds
IT-Consulting Bernhard Thalmayr
Herxheimer Str. 5, 83620 Vagen (Munich area), Germany
Tel: +49 (0)8062 7769174
Mobile: +49 (0)176 55060699
bernhard.thalmayr_at_painstakingminds.com - Solution Architect
This e-mail may contain confidential and/or privileged information.If 
you are not the intended recipient (or have received this email in 
error) please notify the sender immediately and delete this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.