Classpath Problems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Classpath Problems

craiggulliver-2
Hi All,

I have a Jetty and Cocoon setup and I want to use the JspServlet for
compiling my jsps in cocoon.  I have an issue where by the class path of the
JspServlet is not as I expect.  The servlet seems to be using the parent
classloader supplied by Cocoon to build it's class path.  However there's an
issue with the Cocoon implementation that makes this problematic.  I won't
get into those details as I don't think they are relavent just yet.  So I
want to work around this problem by specifying the class path through other
means.  And the end result is that I want the JspServlet to have a classpath
that includes the classes from the Cocoon web app.

My first attempt was to move the servlet configuration from the
webdefaults.xml into the web descriptor for the cocoon web app.  I thought
that the JspServlet would use the correct classpath since it would be loaded
within the web app of interest.  I read that the classpath should be
"Created dynamically based on the current web application", which is
directly from jetty documentation.  This did not work or affect the class
path in any way.

The second attempt was to explictly specify the classpath for the jsp
servlet using an init-param, the classpath.  This does not work either.  I'm
convinced that I have jetty mis-configured, either that or I've interpretted
the documentation incorrectly.

Aside from rewriting some code in Cocoon, which I'm not willing to do, I
don't see any other solutions. I don't understand why the JspServlet is not
using the correct classpath. I've spent countless hours on this and I'm in
need of help.  Is there anyone that can help me, shed some light on the
problem, or point me in the right direction?

I am using Jetty 5.1.5, including jasper 2 from tomcat, and Cocoon 2.1.7.

Here's my jetty xml configuration file:
<Configure class="org.mortbay.jetty.Server">
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketListener">
        <Set name="Port"><SystemProperty name="jetty.port"
default="8888"/></Set>
        <Set name="MinThreads">5</Set>
        <Set name="MaxThreads">100</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">5000</Set>
      </New>
    </Arg>
  </Call>
  <Call name="addWebApplication">
    <Arg>/</Arg>
    <Arg><SystemProperty name="webapp" default=""/>webapps/cocoon</Arg>
    <Set name="defaultsDescriptor"><SystemProperty name="home"
default="."/>/conf/webdefault.xml</Set>
    <Set name="extractWAR">false</Set>
  </Call>
</Configure>

And here's JspServlet configuration from the web.xml:
  <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>classPath</param-name>
        <param-value>WEB-INF/classes;WEB-INF/lib</param-value>
    </init-param>
    <init-param>
        <param-name>logVerbosityLevel</param-name>
        <param-value>DEBUG</param-value>
    </init-param>
    <init-param>
        <param-name>fork</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>


I can provide more information if necessary.

All help is very much appreciated.  Thanks in advance.


Craig W Gulliver





-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss