File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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 org.apache.cocoon.processor.xsp.language.java.SunJavaCompiler.compile(SunJavaCompiler.java:68)
at org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(Compiled 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(Cocoon.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479) "
----------------------------------------------------------------
Can anyone please help me out.
Here is the Sample.xml and Sample.xsl files.
Sample.xml
<?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"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>

<xsp:logic>
private static int numHits = 0;

private synchronized int getNumHits( ) {
return ++numHits;
}
</xsp:logic>

<page>
<title>Hit Counter</title>

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

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>

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

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

</xsl:stylesheet>
----------------------------------------------------------------
Thanks in advance.
Regards,
SHAILENDRA.
 
I agree. Here's the link: http://aspose.com/file-tools
 
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