Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error running Cocoon

shailendra vasale
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic