cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Hunsberger <peter.hunsber...@gmail.com>
Subject Re: Reuse of pipelines in java
Date Wed, 17 Aug 2011 19:46:08 GMT
[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...

Mime
View raw message