File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Error running Cocoon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Error running Cocoon" Watch "Error running Cocoon" New topic

Error running Cocoon

shailendra vasale
Ranch Hand

Joined: Dec 17, 2000
Posts: 38
hi All,
I'm running Sample.xml example which I placed under ../samples
directory along with Sample.xsl.When I invoke the url as -" http://localhost:8080/cocoon/samples/Sample.xml " running tomcat server,the cocoon engine throws as exception -
" java.lang.NoClassDefFoundError: sun/tools/javac/Main
at Code)
at org.apache.cocoon.processor.xsp.XSPProcessor.process(Compiled Code)
at org.apache.cocoon.Engine.handle(Compiled Code)
at org.apache.cocoon.Cocoon.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.tomcat.core.ServletWrapper.doService(
at org.apache.tomcat.core.Handler.service(
at org.apache.tomcat.core.ServletWrapper.service(
at org.apache.tomcat.core.ContextManager.internalService(
at org.apache.tomcat.core.ContextManager.service(
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ Code)
at "
Can anyone please help me out.
Here is the Sample.xml and Sample.xsl files.
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="../samples/Sample.xsl" type="text/xsl"?>

<xsp age language="java"

private static int numHits = 0;

private synchronized int getNumHits( ) {
return ++numHits;

<title>Hit Counter</title>

<p>I've been requested <xsp:expr>getNumHits( )</xsp:expr> times.</p>
</xsp age>
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"

<xsl:template match="page">
<xsl rocessing-instruction name="cocoon-format">
</xsl rocessing-instruction>
<title><xsl:value-of select="title"/></title>
<xsl:apply-templates select="*[not(self::title)]" />

<xsl:template match="p">
<p align="center">
<xsl:apply-templates />

Thanks in advance.
I agree. Here's the link:
subject: Error running Cocoon
Similar Threads
How to run XSP? Urgent!!!!
Colon inside tag and xsl referring two xml
error: param value not a node-set
Using xsl:choose in Cocoon
HTML Tags in XML file