karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: How to Guarantee that a WAR Imports the Same Version of javax.servlet As Pax Web?
Date Wed, 04 May 2011 19:25:15 GMT
Just as reminder, it's the same problem outside OSGi/Karaf. For 
instance, try to deploy a WAR in Tomcat or JBoss if you embed 
servlet.jar from another version, it will fail ;)

The J2EE best practice specifies to avoid to include servlet.jar in the 
webapp classloader.


On 05/04/2011 09:05 PM, Achim Nierbeck wrote:
> Hi could you please provide some more information on which karaf version
> and what you have included inside your war archive. But from my
> experience this is due to the fact that your war archive includes some
> sort of
> servlet.jar which is actually not allowed by any web container, just
> that the
> regular tomcat / jetty with it's hierarchical classloader has no issue
> with this
> since the servlet jar is already loaded.
> So for you it's just to get the servlet.jar out of your classpath or
> better remove it
> out of the war archive.
> Btw. a future version of pax-web will make sure that the servlet.jar is not
> included in the classpath.
> regards, Achim
>> I am running into an issue wherein the Pax Web WAR Extender is
>> importing a
>> different version of javax.servlet than a WAR that it is deploying. This
>> causes class cast exceptions on javax.servlet.*. I tried specifying the
>> version of javax.servlet in my WAR's manifest as the same version that
>> was
>> being imported by the WAR Extender, but I discovered that the WAR
>> Extender
>> picks up different versions of javax.servlet depending on when it is
>> loaded.
>> Is there a way to guarantee that my war picks up the same version of
>> javax.servlet as the PAX Web War Extender?
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/How-to-Guarantee-that-a-WAR-Imports-the-Same-Version-of-javax-servlet-As-Pax-Web-tp2900224p2900224.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.

View raw message