Metro + Jetty + OSGi = pain
- by mjgp2
I am trying to swap out Sun's HTTPServer for the much better Jetty server, within an OSGi bundle, running on Equinox.
I have tried this:
System.setProperty("com.sun.net.httpserver.HttpServerProvider","org.mortbay.jetty.j2se6.JettyHttpServerProvider");
but when endpoint.publish(url) is called, and the server is spawned, it complains of a ClassNotFoundException for org.mortbay.jetty.j2se6.JettyHttpServerProvider.
However, the correct jars are in the bundle, and indeed in the Activator I can instantiate a org.mortbay.jetty.j2se6.JettyHttpServerProvider.
I think that this is a some kind of classpath issue - the spawned server is in a different classpath maybe? I have tried adding the JARs in at the JDK level, but this doesn't make any difference.
Can oanyone shed any light how on earth to get this working?
P.S. Maybe hideous System.setProperty calls will vanish from the world one day. Hopefully :)