Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.1.22
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Windows
-
Testcase included:yes
-
Number of attachments :
Description
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:
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="extraClasspath">c:/tmp</Set>
</Configure>
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
ang.NoClassDefFoundError: A
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.
Oleg,
I am trying to reproduce the issue and getting an exception "java.lang.UnsupportedClassVersionError: bad version number in .class file" for some reason. Could you please provide the source code so that I can build it here?
Thanks,
Michael