cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Wyngaard " <>
Subject Problem with map:generate, cocoon: URLs, and internal pipelines cached with ExpiresCachingProcessingPipeline
Date Thu, 10 Jan 2008 03:09:30 GMT
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="noncaching">

  <map:pipe name="caching"

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


  <map:pipe name="noncaching"
line" />





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

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





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

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

    <map:parameter name="cache-key"
value="{request:sitemapURI}?{cache-keygen:request-params}" />

    <map:match pattern="data">


      <map:transform type="sql">








When I remove the type="caching" from the internal pipeline, everything
works great.  I can access
am2=%7b...%7d&> ..., and all is well.


However, with the type="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="xml"> - [at the <map:serializer ...>
line in the internal-only pipeline]


My current workaround is to replace:


<map:generate src="cocoon:raw:/data?query_string=..." />




<map:aggregate element="dummy">

  <map:part src="cocoon:raw:/data?query_string=..." />


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


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


Is this a bug in Cocoon 2.2 trunk?






View raw message