Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Starting embedded jetty using URLClassLoader

Hello,

I have an existing embedded Jetty server (9.3.8.v20160314) which works great when I run it with:
java -cp "jar1.jar:jar2.jar:..." MyEmbeddedServer

However I am trying to launch it using a URLClassLoader, giving it the URL of those exact same JAR files (no wildcard, same exact order), and somehow Jetty starts but doesn't deploy my WARs any more, it completely skip them and show directly:

2016-05-24 15:50:08 INFO  o.e.j.s.Server:345 - jetty-9.3.8.v20160314
2016-05-24 15:50:08 INFO  o.e.j.s.ServerConnector:270 - Started ServerConnector@236861da{HTTP/1.1,[http/1.1]}{0.0.0.0:7070}
2016-05-24 15:50:08 INFO  o.e.j.s.ServerConnector:270 - Started ServerConnector@41e8d917{SSL,[ssl, http/1.1]}{0.0.0.0:7171}

I manually verified in the MyEmbeddedServer class that the list of jar of the current (URL)ClassLoader was the exact same. Note that the system property "java.class.path" is obviously not the same.

Any idea what could be going on here?

Thanks,
Benjamin

Back to the top