Classpath Problems

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

Classpath Problems

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">
      <New class="org.mortbay.http.SocketListener">
        <Set name="Port"><SystemProperty name="jetty.port"
        <Set name="MinThreads">5</Set>
        <Set name="MaxThreads">100</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="LowResourcePersistTimeMs">5000</Set>
  <Call name="addWebApplication">
    <Arg><SystemProperty name="webapp" default=""/>webapps/cocoon</Arg>
    <Set name="defaultsDescriptor"><SystemProperty name="home"
    <Set name="extractWAR">false</Set>

And here's JspServlet configuration from the web.xml:

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.
jetty-discuss mailing list
[hidden email]