Hi,

I have successfully used the CastorTransformer. I am working on a new
version that can be used to marshal and unmarshal, and doesn't use
deprecated classes/code anymore. It's not finished, but I allready use it in
a project.

I have it working in the latest CVS version of Cocoon, but it will probably
also work with 2.03. If you'r interessted, I can mail a copy of the latest
source.

You'r problem sounds like a classpath/version issue, otherwise I can also
find no explanation for the NoSuchMethodError

HTH,

Michael

-----Original Message-----
From: Werner Guttmann
To: [EMAIL PROTECTED]
Sent: 20-9-2002 5:07 
Subject: Re: Cocoon 2.0.3 and CastorTransformer

Thanks, Vadim. Now, please find below the stack trace (just the root
cause) from
Catalina's app specific log file. Looking at line 94  of
CastorTransformer.java
(from the scratchpad of the Cocoon 2.0.3 source dist) I can see that it
fails on
the line marked with --> <---, but simply woul dnot know enough to tell
why ?

Is anybody actually using the CastorTransformer sucessfully ?

Werner

   /**
     * Inner class eventhandler, forward the Castor SAX events
     * to Cocoon 2 Events
     */
    CastorEventAdapter = new HandlerBase(){
    public void startElement(String name, AttributeList attributes)
throws
SAXException
        {
          AttributesImpl a= new AttributesImpl();
          for(int i=0;i <attributes.getLength(); i++){

a.addAttribute("",attributes.getName(i),attributes.getName(i),
                          "",attributes.getValue(i));
          }

--->
CastorTransformer.super.contentHandler.startElement("",name,name,a);
<----
        }

        public void characters(char[] chars, int offset, int length)
throws
SAXException
        {
          CastorTransformer.super.contentHandler.characters(chars,
offset,
length);
        }

        public void endElement(String name) throws SAXException
        {

          CastorTransformer.super.contentHandler.endElement("",
name,name);
        }
    };
  }




java.lang.NoSuchMethodError
        at
org.apache.cocoon.transformation.CastorTransformer$1.startElement(Castor
Transformer.java:94)

        at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:876)
        at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:540)
        at
org.apache.cocoon.transformation.CastorTransformer.insertBean(CastorTran
sformer.java:225)

        at
org.apache.cocoon.transformation.CastorTransformer.process(CastorTransfo
rmer.java:173)

        at
org.apache.cocoon.transformation.CastorTransformer.startElement(CastorTr
ansformer.java:132)

        at
org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java
:118)
        at
org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
        at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLVal
idator.java:1284)

        at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentSc
anner.java:1806)

        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatc
h(XMLDocumentScanner.java:1182)

        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScan
ner.java:381)

        at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
        at
org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:269)
        at
org.apache.avalon.excalibur.xml.JaxpParser.parse(JaxpParser.java:222)
        at
org.apache.cocoon.components.source.AbstractStreamSource.toSAX(AbstractS
treamSource.java:206)

        at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:1
43)
        at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cachi
ngEventPipeline.java:250)

        at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(Cach
ingStreamPipeline.java:399)

        at
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(
SerializeNode.java:153)

        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:85)

        at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i
nvoke(PreparableMatchNode.java:156)

        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:109)

        at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P
ipelineNode.java:140)

        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:109)

        at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(
PipelinesNode.java:144)

        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:328)

        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:293)

        at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
        at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:679)

        at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
atcher.java:431)

        at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
cher.java:355)

        at
org.apache.struts.action.ActionServlet.processActionForward(ActionServle
t.java:1759)

        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
        at
com.msdw.futopt.expiry.http.ExpiryActionServlet.doPost(ExpiryActionServl
et.java:172)

        at
com.msdw.futopt.expiry.http.ExpiryActionServlet.doGet(ExpiryActionServle
t.java:140)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)

        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:243)

        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:201)

        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
4)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:164)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)

        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462
)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:163)

        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
ava:1011)

        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
1106)
        at java.lang.Thread.run(Thread.java:484)


Vadim Gritsenko wrote:

> Werner Guttmann wrote:
>
> >Thanks, Vadim, for pointing this out. I just changed this back to be
in line
> >with the CASTOR_URI declaration in CastorTransformer.java, i.e. use a
> >namespace declaration of
> >
> >xmlns:castor="http://castor.exolab.org/cocoontransfomer";
> >
> >in my page. Though now I am facing the same problem as in my original
email,
> >iow I am still getting a NPE. Any idea why ?
> >
>
> No, I don't; and I have not read your original email: I've not worked
> with Castor (yet).
>
> Vadim
>
> >Werner
> >
> >Vadim Gritsenko wrote:
> >
> >
> >
> >>Werner Guttmann wrote:
> >>...
> >>
> >>
> >>
> >>>PS Btw, the Castor sample shipped with Cocoon 2.0.3 has an error in
the
> >>>namespace documentation of the test.xml file, iow it really reads
> >>>
> >>><?xml version="1.0"?>
> >>><zoo xmlns:castor="http://castor.exolab.org/cocoontransfomer";>
> >>>
> >>>
> >>>
> >>Actually, this is not error in demo; it's a typo in a transformer
> >>itself. Thanks for pointing this out.
> >>
> >>This namespace typo can easily be fixed because this transformer is
> >>still in the scratchpad (== alpha).
> >>
> >>Vadim
> >>...
> >>
> >>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to