I have a Java object that I am trying to turn into XML in my custom
generator class.  I am trying to use Castor to do this.  I am not sure how
to integrate Castor into the generator class.  My concern is how I set the
ContentHandler.  Does anyone have any input.  There was not much on the web
about this.

Thanks,
Gary

Custom generator:

public void generate() throws SAXException, IOException
    {
      try
      {
        ClaimActivity claim = new ClaimActivity();
        claim.setInsuredName("Joe Shmoe");

        // the org.xml.sax.ContentHandler is inherited
        // through org.apache.cocoon.xml.AbstractXMLProducer
        Marshaller.marshal(new ClaimActivity(), contentHandler);
      }
      catch (ValidationException valex)
      {
        valex.printStackTrace();
      }
      catch (MarshalException marex)
      {
        marex.printStackTrace();
      }
    }


Her is the error that I am getting:

<Mar 21, 2003 9:03:03 AM EST> <Error> <HTTP> <101017>
<[ServletContext(id=546240
3,name=cocoon,context-path=/cocoon)] Root cause of ServletException
java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer
        at org.exolab.castor.xml.Marshaller.initialize(Marshaller.java:383)
        at org.exolab.castor.xml.Marshaller.<init>(Marshaller.java:329)
        at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:665)
        at COPRGenerator.generate(COPRGenerator.java:43)
        at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Ca
chingEventPipeline.java:258)
        at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(C
achingStreamPipeline.java:412)
        at
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invo
ke(SerializeNode.java:148)
        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo
de.invokeNodes(AbstractParentProcessingNode.java:84)
        at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNod
e.invoke(PreparableMatchNode.java:164)
        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo
de.invokeNodes(AbstractParentProcessingNode.java:108)
        at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invok

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to