[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] javax.servlet.http classloading problem

Hi Dirk

I assume you are using the servletbridge to deploy equinox into an existing servlet container (tomcat, jetty, etc.). In this case the FrameworkLauncher class is used to launch an embedded equinox instance to host the content of the application as bundles. We want to use the javax.servlet APIs from the hosting web container. What is interesting is that you state the versions of the packages are "0.0.0" in your environment. This means that your hosting environment is returning "0" from ServletContext.getMajorVersion() and ServletContext.getMinorVersion().

The method org.eclipse.equinox.servletbridge.FrameworkLauncher.deployExtensionBundle(File) ends up installing a system bundle fragment which exports the packages from the hosting environment. This is how the servlet.bundle is getting configured to export the javax.servlet packages. The org.osgi.framework.system.packages (and bootdelegation) properties do not affect the exports from this fragment.

Tom



Inactive hide details for Dirk Jacobs ---04/21/2009 04:21:30 AM---Hi, I'm running on platform 3.4.2 and encountered the followiDirk Jacobs ---04/21/2009 04:21:30 AM---Hi, I'm running on platform 3.4.2 and encountered the following problem


From:

Dirk Jacobs <dirk.jacobs@xxxxxxxxxx>

To:

equinox-dev@xxxxxxxxxxx

Date:

04/21/2009 04:21 AM

Subject:

[equinox-dev] javax.servlet.http classloading problem




Hi, I'm running on platform 3.4.2 and encountered the following problem
during development :

When doing a package import of javax.servlet.http and NOT specifying a
version,
the package that is loaded is always from the system bundle :
javax.servlet.http; version="0.0.0"<System Bundle [0]>

If we specify a version in the import packages, we get our correct
package :
javax.servlet.http;
version="2.4.0"<initial@reference:
file:../others/javax.servlet_2.4.0.v200706111738.jar/ 
[52]>


We tried a lot of thing but we couldn't prevent equinox from loading the
system bundle if no explicit version is specified.
We tried to use :

org.osgi.framework.system.packages
org.osgi.framework.bootdelegation


But no luck. (with other packages like sun.*, com.sun.* we could
succesfully control the loading process)

At the end, the problem is that you get 'package usage conflict errors'
because 2 different versions of javax.servlet.http get loaded.
For code we own, this is not a problem, we can add the version but for
third-party lib's (bundles we are using), this is not possible.




_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image