From dev-return-102963-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Wed Aug 17 19:46:37 2011 Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A5C67F5A for ; Wed, 17 Aug 2011 19:46:37 +0000 (UTC) Received: (qmail 82864 invoked by uid 500); 17 Aug 2011 19:46:37 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 82805 invoked by uid 500); 17 Aug 2011 19:46:36 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 82798 invoked by uid 99); 17 Aug 2011 19:46:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2011 19:46:36 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of peter.hunsberger@gmail.com designates 209.85.214.51 as permitted sender) Received: from [209.85.214.51] (HELO mail-bw0-f51.google.com) (209.85.214.51) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2011 19:46:28 +0000 Received: by bkar19 with SMTP id r19so1354690bka.24 for ; Wed, 17 Aug 2011 12:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=G3KhknC7c7dFank/jCi/EBqYqeqrhmq9qvfa75dRO6M=; b=SFyzbG8hYH4mPNJmxoPWKQXYgWkGeeBVcFrVakqry+GnCx8HXGE0AdpzSP+VYVP8XO kJpNC+xOALCPsr8c5VMIbtohtSJBfQfpME/NUYXyQCO7uGSCd974LzOSTH8FVWnblR6o D1AzyvRXPJwZ3ujMjZSomtmNxywC7hGCdgsaw= MIME-Version: 1.0 Received: by 10.205.65.76 with SMTP id xl12mr653976bkb.166.1313610368447; Wed, 17 Aug 2011 12:46:08 -0700 (PDT) Received: by 10.204.115.65 with HTTP; Wed, 17 Aug 2011 12:46:08 -0700 (PDT) In-Reply-To: <1313608271.3515.23.camel@mcKenny> References: <1313176118.11518.14.camel@mcKenny> <4E47BD30.1090401@apache.org> <4E4A1B50.3040608@indoqa.com> <1313482106.3784.10.camel@mcKenny> <1313608271.3515.23.camel@mcKenny> Date: Wed, 17 Aug 2011 14:46:08 -0500 Message-ID: Subject: Re: Reuse of pipelines in java From: Peter Hunsberger To: dev@cocoon.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [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 =A0summaryTransformer.setup(...) and I figured that > StAXConsumer consumer =3D 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...