users@jersey.java.net

Re: [Jersey] Re: how to deploy bookstore sample in Glassfish v2.1?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 15 May 2009 11:21:04 +0200

On May 14, 2009, at 7:58 PM, Felipe Gaúcho wrote:

> in the log file:
>
> [#|2009-05-14T19:57:07.243+0200|INFO|sun-appserver9.1|
> javax.enterprise.system.tools.deployment|
> _ThreadID=19;_ThreadName=Timer-16;|deployed
> with moduleid = bookstore|#]
>
> [#|2009-05-14T19:57:07.358+0200|SEVERE|sun-appserver9.1|
> javax.enterprise.system.container.web|
> _ThreadID=19;_ThreadName=Timer-16;_RequestID=4a0b66cf-6a96-4e30-
> be92-0e664d059a03;|WebModule[/bookstore]PWC1270:
> Exception starting filter Jersey Filter
> java.lang.ClassCastException:
> com.sun.jersey.spi.container.servlet.ServletContainer cannot be cast
> to javax.servlet.Filter
>

Do you have a different version of Jersey installed in GF v2 by the
update center to the version of the sample you are using? I am
guessing that is the case.

We are experiencing technical difficulties pushing out 1.0.3 and 1.1.0-
ea to the GF v2 update center :-(

You can modify the class loader delegation to be false in the sun-
web.xml of the sample:

<sun-web-app error-url="">
   <context-root>/bookstore</context-root>
   <class-loader delegate="false"/>
   <jsp-config>
     <property name="keepgenerated" value="true">
       <description>Keep a copy of the generated servlet class' java
code.</description>
     </property>
   </jsp-config>
</sun-web-app>

and thus the classes in the Jersey jars distributed with the sample
with override those in the GF distribution.

Paul.