cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Wyngaard " <PWynga...@compendiabio.com>
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"
src="org.apache.cocoon.components.pipeline.impl.ExpiresCachingProcessing
Pipeline">

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

  </map:pipe>

  <map:pipe name="noncaching"
src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipe
line" />

</map:pipes>

 

<map:pipelines>

  <map:pipeline>

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

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

      ...

    </map:match>

  </map:pipeline>

 

  <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">

      ...

      </map:transform>

      ...

    </map:match>

  </map:pipeline>

</map:pipelines>

 

When I remove the type="caching" from the internal pipeline, everything
works great.  I can access
http://localhost:8888/myblock/transformed-data.xml?param1={...}&param2={
...}&
<http://localhost:8888/myblock/transformed-data.xml?param1=%7b...%7d&par
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=..." />

 

with:

 

<map:aggregate element="dummy">

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

</map:aggregate>

<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?

 

Thanks,

 

Peter

 


Mime
View raw message