You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Yingfang Tian <yi...@gmail.com> on 2004/12/03 04:59:05 UTC

simple custom generator

Hi, I am new to Cocoon. I try to write a cusom generator and follow
the guide described in
http://cocoon.apache.org/2.1/tutorial/tutorial-generator.html#Simple+Example.
When I compile the HelloWorldGenerator.java, the following errors
showed up.Could you give me any suggestion? Thank you very much.

(HelloWorldGenerator.java is copied from the above website, I put
cocoon-2.0.4.jar and xml-apis.jar in the c:\cocopractice\lib.
My environment is : j2sdk1.4.2_06;  jakarta-tomcat-4.1.31;  cocoon-2.0.4)

C:\CoCoPractice\test>javac -classpath
c:\cocopractice\lib\cocoon-2.0.4.jar;c:\cocopractice\lib\xml-apis.jar
HelloWorldGenerator.java

HelloWorldGenerator.java:5: cannot access
org.apache.avalon.framework.component.Component
file org\apache\avalon\framework\component\Component.class not found
public class HelloWorldGenerator extends AbstractGenerator
         ^
HelloWorldGenerator.java:24: cannot resolve symbol
symbol  : variable contentHandler
location: class HelloWorldGenerator
     contentHandler.startDocument();
     ^
HelloWorldGenerator.java:26: cannot resolve symbol
symbol  : variable contentHandler
location: class HelloWorldGenerator
     contentHandler.startElement("", "example", "example", emptyAttr);
     ^
HelloWorldGenerator.java:28: cannot resolve symbol
symbol  : variable contentHandler
location: class HelloWorldGenerator
     contentHandler.characters("Hello World!".toCharArray(),0,
     ^
HelloWorldGenerator.java:31: cannot resolve symbol
symbol  : variable contentHandler
location: class HelloWorldGenerator
     contentHandler.endElement("","example", "example");
     ^
HelloWorldGenerator.java:33: cannot resolve symbol
symbol  : variable contentHandler
location: class HelloWorldGenerator
     contentHandler.endDocument();
     ^
6 errors

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


Re: simple custom generator

Posted by Jorg Heymans <jh...@domek.be>.

Yingfang Tian wrote:
> Hi, I am new to Cocoon. I try to write a cusom generator and follow
> the guide described in
> http://cocoon.apache.org/2.1/tutorial/tutorial-generator.html#Simple+Example.
> When I compile the HelloWorldGenerator.java, the following errors
> showed up.Could you give me any suggestion? Thank you very much.
> 
> (HelloWorldGenerator.java is copied from the above website, I put
> cocoon-2.0.4.jar and xml-apis.jar in the c:\cocopractice\lib.
> My environment is : j2sdk1.4.2_06;  jakarta-tomcat-4.1.31;  cocoon-2.0.4)

1) you need the avalon / excalibur libraries in order to compile. Have a 
look in WEB-INF/lib of your cocoon installation for these.
2) Just FYI, development of the cocoon 2.0.X branch stopped about 2 
years ago. Current active branch is 2.1.X

HTH
Jorg


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