I have an external jar that I do not want to associate with my webapp....">

Problems setting the Jetty class path with <Set name = "extraClasspath">

I have an external jar that I do not want to associate with my webapp. I put him on the way of the pier. Unfortunately, the environment in which I deploy is very restrictive, and I can only write two directories: one that contains contexts and one that contains webapps.

I selected the external jar in the webapp directory. To make it visible to my webapp, I configure WebAppContext to see this additional jar. This is my myAppContext.xml file

<Configure id="myContext" class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/myApp</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/myApp.war</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
<Set name="extraClasspath"><SystemProperty name="jetty.home" default="."/>/webapps/myExternalJAR.jar</Set>
<New class="com.mycompany.mypackage.MyExternalClass"></New>

The last line tries to create an instance of MyExternalClass, which can be found in my external bank. When jetty starts, I get a ClassNotFoundException in this very line of the configuration file.

Is there something I am missing? According to the specification, this should work. I would really appreciate any advice on how to deal with this.

+5
source share

All Articles