Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 29892 invoked from network); 10 Jan 2008 07:40:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2008 07:40:19 -0000 Received: (qmail 45736 invoked by uid 500); 10 Jan 2008 07:40:03 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 45686 invoked by uid 500); 10 Jan 2008 07:40:03 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Delivered-To: moderator for users@cocoon.apache.org Received: (qmail 71840 invoked by uid 99); 10 Jan 2008 03:10:38 -0000 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C85336.35A4F8BF" Subject: Problem with map:generate, cocoon: URLs, and internal pipelines cached with ExpiresCachingProcessingPipeline Date: Wed, 9 Jan 2008 19:09:30 -0800 Message-ID: <0C5CB2D69083944F9A17C6F3614C529902201354@EXVBE014-11.exch014.msoutlookonline.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with map:generate, cocoon: URLs, and internal pipelines cached with ExpiresCachingProcessingPipeline Thread-Index: AchTNje7lmpR4zwnTcSQ2iy/zwxFqg== From: "Peter Wyngaard " To: X-OriginalArrivalTime: 10 Jan 2008 03:10:18.0246 (UTC) FILETIME=[53FC9260:01C85336] X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C85336.35A4F8BF Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable In a previous message(s), I mentioned that I created an internal-only pipeline, cached with ExpiresCachingProcessingPipeline. This pipeline supports many URLs that return objects from a database using SQL Transformer. The caching is important, as many of the database operations are time consuming. =20 I've built several additional pipelines that aggregate and transform the "raw" database XML returned by the caching internal-only pipeline. So here's an abbreviated sitemap.xmap to illustrate the problem: =20 =20 ... =20 ... ... ... =20 When I remove the type=3D"caching" from the internal pipeline, = everything works great. I can access http://localhost:8888/myblock/transformed-data.xml?param1=3D{...}¶m2=3D= { ...}& ..., and all is well. =20 However, with the type=3D"caching" in place, every other request for transformed-data.xml fails with the following exception: =20 Caused by: org.apache.cocoon.ProcessingException: Serializer already set. Cannot set serializer 'xml' at - [at the line in the internal-only pipeline] =20 My current workaround is to replace: =20 =20 with: =20 =20 The remove-dummy.xsl just removes the ... element that map:aggregate adds. =20 Is this a bug in Cocoon 2.2 trunk? =20 Thanks, =20 Peter =20 ------_=_NextPart_001_01C85336.35A4F8BF Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

In a previous message(s), I mentioned that I = created an internal-only pipeline, cached with = ExpiresCachingProcessingPipeline.  This pipeline supports many URLs that return objects from a database = using SQL Transformer.  The caching is important, as many of the database = operations are time consuming.

 

I've built several additional pipelines that = aggregate and transform the "raw" database XML returned by the caching internal-only pipeline.  So here's an abbreviated sitemap.xmap to illustrate the problem:

 

<map:pipes default=3D"noncaching">

  <map:pipe name=3D"caching" src=3D"org.apache.cocoon.components.pipeline.impl.= ExpiresCachingProcessingPipeline">

    <map:parameter name=3D"cache-expires" value=3D"-1" /> = <!-- never expire -->

  </map:pipe>

  <map:pipe name=3D"noncaching" src=3D"org.apache.cocoon.components.pipeline.impl.= NonCachingProcessingPipeline" />

</map:pipes>

 

<map:pipelines>

  <map:pipeline>

    <map:match pattern=3D"transformed-data.xml">

  =     <map:generate src=3D"cocoon:raw:/data?query_string=3D{…}" = />

  =     …

  =   </map:match>

  </map:pipeline>

 

  <map:pipeline = type=3D"caching" internal-only=3D"true">

  =   <map:parameter name=3D"purge-cache" value=3D"{request-param:purge}" />

  =   <map:parameter name=3D"cache-key" value=3D"{request:sitemapURI}?{cache-keygen:request-para= ms}" />

  =   <map:match pattern=3D"data">

  =     …

  =     <map:transform type=3D"sql">

  =     …

  =     </map:transform>

  =     …

  =   </map:match>

  </map:pipeline>

</map:pipelines>

 

When I remove the type=3D"caching" from = the internal pipeline, everything works great.  I can access http://localhost:8888/myblock/transform= ed-data.xml?param1=3D{...}&param2=3D{...}&..., and all is well.

 

However, with the type=3D"caching" in = place, every other request for transformed-data.xml fails with the following = exception:

 

Caused by: org.apache.cocoon.ProcessingException: = Serializer already set. Cannot set serializer 'xml'

        at <map:serialize type=3D"xml"> - [at the = <map:serializer …> line in the internal-only pipeline]

 

My current workaround is to replace:

 

<map:generate = src=3D"cocoon:raw:/data?query_string=3D…" />

 

with:

 

<map:aggregate element=3D"dummy">

  <map:part src=3D"cocoon:raw:/data?query_string=3D…" />

</map:aggregate>

<map:transform src=3D"remove-dummy.xsl" type=3D"saxon" />

 

The remove-dummy.xsl just removes the = <dummy>…</dummy> element that map:aggregate adds.

 

Is this a bug in Cocoon 2.2 trunk?

 

Thanks,

 

Peter

 

------_=_NextPart_001_01C85336.35A4F8BF--