You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steven Maring <St...@trcinc.com> on 2000/03/28 17:59:10 UTC

classloader problems in Cocoon-1.7?

I have been having some VERY strange problems with Cocoon-1.7 that I think
relate to either a class loading issue or using XSL transformations to
generate XML pages with XSP to be processed. 

1)  All of the cocoon samples work except the clean-page.xml one.  It
returns the XHTML with no dynamic data and this in the error_log:

XSL Warning: xsl:stylesheet requires a 'version' attribute!
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:logic. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:logic. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:attribute. The
attribute will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:logic. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:logic. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:attribute. The
attribute will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:logic. The attribute
will be ignored.
XSL Warning: Could not resolve namespace prefix: xsp:expr. The attribute
will be ignored.
XSL Warning: xsl:stylesheet requires a 'version' attribute!


2)  http://localhost/Cocoon.xml throws an internal server error with this in
the logs:

[28/03/2000 10:20:28:598 EST] java.lang.NoClassDefFoundError:
org/apache/fop/apps/Version
        at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:320)
        at org.apache.jserv.JServConnection.run(JServConnection.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)

However, the fop jar is correctly referenced in the wrapper.classpath


3)  I also have problems loading classes, either existing APIs or my own
into XSP.  As an example, here is an XSL file I am using to generate an
XML/XSP:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
	<xsl:processing-instruction
name="cocoon-process">type="xsp"</xsl:processing-instruction>
	<xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core">
		<page>
		<xsp:structure>
			<xsp:include>java.util.HashMap</xsp:include>
			<xsp:include>java.net.URL</xsp:include>
		</xsp:structure>
		<xsp:logic>
			try {
				HashMap requestParams =
DataServletUtils.getParameters( request );
				String username = (String)
requestParams.get( "username" );
				String password = (String)
requestParams.get( "password" );
				URL url = new URL(
"http://luckydog/modelSystem/redirected.xml" );
				HashMap responseParams = new HashMap();
				responseParams.put( "username", username );
				DataServletUtils.redirect( url, response,
responseParams );
			} catch (Exception e) {
				e.printStackTrace();
			}
		</xsp:logic>
		</page>
	</xsp:page>
</xsl:template>
</xsl:stylesheet>

This also throws similar warnings as in item 2 above and fails with:


Error found handling the request.
java.lang.Exception: XSP Java Compiler: Compilation failed for _login.java
91: Undefined variable or class name: DataServletUtils
    HashMap requestParams = DataServletUtils.getParameters( request );
                            ^
95: Class _data._htdocs._modelSystem.URL not found.
    URL url = new URL( "http://luckydog/modelSystem/redirected.xml" );
    ^
95: Class _data._htdocs._modelSystem.URL not found.
    URL url = new URL( "http://luckydog/modelSystem/redirected.xml" );
    ^
98: Undefined variable or class name: DataServletUtils
    DataServletUtils.redirect( url, response, responseParams );
    ^
4 errors
at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJa
vaProcessor.java, Compiled Code)
at org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java,
Compiled Code)
at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
at org.apache.cocoon.Cocoon.service(Cocoon.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java,
Compiled Code)
at org.apache.jserv.JServConnection.run(JServConnection.java, Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)



If I don't reference any other APIs, everything works fine.  I have put my
classes in the system CLASSPATH as well as the JServ classpath as follows:

wrapper.classpath=/usr/local/apache/libexec/ApacheJServ.jar
wrapper.classpath=/usr/local/JSDK2.0/lib/jsdk.jar
wrapper.classpath=/usr/local/cocoon-1.7/bin/cocoon.jar
wrapper.classpath=/usr/local/xerces-1_0_3/xerces.jar
wrapper.classpath=/usr/local/xalan_1_0_0/xalan.jar
wrapper.classpath=/usr/local/cocoon-1.7/lib/xml.jar
wrapper.classpath=/usr/local/cocoon-1.7/lib/fop_0_12_1.jar
wrapper.classpath=/usr/local/jdk1.2.2/lib/tools.jar
wrapper.classpath=/data/modelSystem/modelsystem.jar
wrapper.classpath=/usr/local/vbroker/lib/vbjapp.jar
wrapper.classpath=/usr/local/vbroker/lib/vbjorb.jar
wrapper.classpath=/usr/local/vbroker/lib/vbjcosev.jar
wrapper.classpath=/usr/local/vbroker/lib/vbjcosnm.jar
wrapper.classpath=/usr/local/xml4j2.0.14/xml4j.jar
wrapper.classpath=/data/modelSystem


I would greatly appriciate any comments.


Steve Maring
Web Engineer
Tampa, FL