Affects Version/s: 6.1.22
Fix Version/s: None
Number of attachments :
Documentation states (http://docs.codehaus.org/display/JETTY/Classloading) that I can add classpath to my application by setting it in jetty-web.xml.
I have attached a simple web application that proves that either documentation is wrong or there is a bug in Jetty.
The application has one primitive servlet that is loaded on startup.
In its init method it tries to load class A that is located in c:/tmp
Application comes with jetty-web.xml that does exactly what documentation says:
Then I run Jetty-Service.exe
EXPECTED: application is started
OBSERVED: application cannot be started b/c of exception
jvm 1 | 2010-03-24 12:53:08.311:WARN::failed HandlerCollection@a31e1b: java.l
jvm 1 | 2010-03-24 12:53:08.311:WARN::Error starting handlers
jvm 1 | java.lang.NoClassDefFoundError: A
jvm 1 | at TestServlet.init(TestServlet.java:8)
At the same time application is started successfully when I supply the additional classpath on command line:
java -Djetty.class.path="c:/tmp" -jar start.jar
If I try to start with no additional classpath
java -jar start.jar
I get the same exception as with Jetty-Service.exe
In other words additional classpath set from jetty-web.xml is simply ignored.
This can be resolved by either fixing the bug or changing the documentation.