cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CraigGulliver" <cgulli...@invoqsystems.com>
Subject Classpath Problems
Date Thu, 13 Oct 2005 06:27:15 GMT
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.  The 
CompilingClassLoader does not extend the URLClassLoader, which the 
JspServlet is expecting.  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 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message