Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] bootstrapping jetty-plus from eclipse equinox: classloader issue and suggested fix

Hi there,

I am having difficulties using org.mortbay.jetty,
org.mortbay.jetty.util, org.mortbay.jetty.plus and org.mortbay.naming
together in an osgi container.
the issue is that when I start the jetty server and configure it with
jetty.xml and jetty-plus.xml from the osgi container, equinox fails.

The classloader of the org.mortbay.jetty.server bundle is not able to
locate the jetty-plus classes:
when jetty tries to load
  <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
  <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
it fails.

The best workaround I am using consists of modifying the manifests of
org.mortbay.jetty.server, org.mortbay.jetty.plus and
org.mortbay.naming to resolve this.
I added to org.mortbay.jetty.server:
     Eclipse-BuddyPolicy: registered
And to the manifests of org.mortbay.jetty.plus and org.mortbay.naming:
     Eclipse-RegisterBuddy: org.mortbay.jetty.server

We could also consider making org.mortbay.jetty.server,
org.mortbay.jetty.plus and org.mortbay.naming fragments that target
org.mortbay.jetty.server. A bit more osgi compliant. But not many osgi
container support fragments yet.

Here is a small project to reproduce the issue:
http://github.com/hmalphettes/osgi-webapp-simple/tree/master (licensed
under the EPL)
The first bundle bootstraps jetty.
The second one is a bundle that contains a web-application.
It works fine because it depends only on jetty, not jetty-plus.
Adding jetty-plus's bundle and using jetty-plus in the config will
reproduce the issue described above.

Let me know if I am missing something or if there is a different way
to install jetty' plus bundles in an osgi container.

Cheers,
Hugues


Back to the top