[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.


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


Dirk Jacobs <dirk.jacobs@xxxxxxxxxx>




04/21/2009 04:21 AM


[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
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 :

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 :


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

GIF image

GIF image