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
From: Dirk Jacobs <[email protected]>
To: [email protected]
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"<init...@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
[email protected]
https://dev.eclipse.org/mailman/listinfo/equinox-dev
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
_______________________________________________ equinox-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/equinox-dev
