cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <scher...@gmail.com>
Subject Re: Reuse of pipelines in java
Date Thu, 18 Aug 2011 09:19:19 GMT
On Wed, 2011-08-17 at 14:46 -0500, Peter Hunsberger wrote:
> [snip...]
> 
> > Now everything is working fine for the first time I use the pipeline.
> > However the second time it is not working anymore. I am using
> > this.addEventToQueue(event) in the transformer to add the events to the
> > queue. However the second time I am calling the transformer I get
> > "org.apache.cocoon.pipeline.ProcessingException: Error during writing
> > output elements."
> >
> > Whiles debug I found that the summaryTransformer is adding correctly the
> > "StartDocument"/"EndDocument" however in the second call the
> > XMLSerializer is getting in initiatePullProcessing() as first event a
> > START_DOCUMENT (which is expected), however
> > resulting in
> > "javax.xml.stream.XMLStreamException: Can not output XML declaration,
> > after other output has already been done."
> >
> > I debugged  summaryTransformer.setup(...) and I figured that
> > StAXConsumer consumer = this.getConsumer();
> > the first time is null, but the second time is the "old" consumer. Can
> > it be related?
> >
> 
> Don't know about C3, but certainly in C2 that  is an issue.  Don't
> recall how to fix it but I think you are looking at the right issue.
> You've either got to clean up after you are done or reset things
> properly when you use it again.  You've got a setup() method to work
> with so that seems the place to start, since adding a new finis() (or
> whatever) method to cleanup after you are done would obviously have
> much broader implications...

Actually I found the problem in my transformer. Since it was a migration
of an interdependent StAX component I forgot to change a throw clause in
one place where before it was controlled. Now it just had thrown the
above XMLStreamException in one document where a non fatal error had
occurred. 

Thanks for your feedback.

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
codeBusters S.L. - web based systems
<consulting, training and solutions>
http://www.codebusters.es/


Mime
View raw message