You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@anyware-tech.com> on 2003/08/15 15:45:27 UTC

Weird bug in aggregation and multiple cocoon: redirects

Hi all,

I encountered a strange bug in an application combining flow and 
aggegation : each page is an aggregation of navigation+content, and the 
content is a call to a flowscript.

The bug seems to be related to multiple cocoon: related. I isolated it 
from the flow :

  <map:match pattern="test1.xml">
    <map:aggregate element="root">
      <map:part src="cocoon:/flow-call.xml"/>
      <!-- other parts removed -->
    </map:aggregate>
    <map:serialize type="xml"/>
  </map:match>
 
  <map:match pattern="flow-call.xml">
    <map:redirect-to uri="cocoon:/flow-view.xml"/>
  </map:match>
 
  <map:match pattern="flow-view.xml">
    <map:generate src="test.xml"/>
    <map:serialize type="xml"/>
  </map:match>

The "flow-call.xml" URI simulates the behaviour of a flowscript, since 
sendPageAndWait("foo") does an internal redirect to "cocoon:/foo".

The exception is :

org.apache.cocoon.ProcessingException: Attempted to process incomplete pipeline.
	at org.apache.cocoon.components.source.impl.SitemapSource.init(SitemapSource.java:419)
	at org.apache.cocoon.components.source.impl.SitemapSource.<init>(SitemapSource.java:248)
	at org.apache.cocoon.components.source.impl.SitemapSourceFactory.getSource(SitemapSourceFactory.java:99)
	at org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:247)
	at org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:503)
	at org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:503)
	at org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:513)
	at org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:500)
	at org.apache.cocoon.sitemap.ContentAggregator.setup(ContentAggregator.java:322)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:381)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:652)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:508)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:470)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:147)
	...


Replacing the part uri by "cocoon:/flow-view.xml" works as expected. So 
I suspect a bug related to chained "cocoon:/" calls, but only within an 
aggregation, since replacing <map:aggregate> by <map:redirect-to 
uri="flow-call.xml"> works correctly.

Any idea anyone ?

Thanks,
Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: Weird bug in aggregation and multiple cocoon: redirects

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Sylvain Wallez wrote:

> Hi all,
>
> I encountered a strange bug in an application combining flow and 
> aggegation : each page is an aggregation of navigation+content, and 
> the content is a call to a flowscript.
>
> The bug seems to be related to multiple cocoon: related. I isolated it 
> from the flow :
>
>  <map:match pattern="test1.xml">
>    <map:aggregate element="root">
>      <map:part src="cocoon:/flow-call.xml"/>
>      <!-- other parts removed -->
>    </map:aggregate>
>    <map:serialize type="xml"/>
>  </map:match>
>
>  <map:match pattern="flow-call.xml">
>    <map:redirect-to uri="cocoon:/flow-view.xml"/>
>  </map:match>
>
>  <map:match pattern="flow-view.xml">
>    <map:generate src="test.xml"/>
>    <map:serialize type="xml"/>
>  </map:match>


Update : the bug occurs also of the <map:aggregate> is replaced by a simple
    <map:generate src="cocoon:/flow-call.xml"/>

So this seems more related to redirects chaining in internal requests...

Thanks for any hint about this.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: Weird bug in aggregation and multiple cocoon: redirects

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Sylvain Wallez wrote:

> Hi all,
>
> I encountered a strange bug in an application combining flow and 
> aggegation : each page is an aggregation of navigation+content, and 
> the content is a call to a flowscript.


Fixed. Redirecting to a "cocoon:" URI within an internal call to the 
sitemap (i.e. "cocoon:" source) was simply not handled (see the funny 
"FIXME - What to do here?" comment in ForwardRedirector).

The fix required a full rewrite of "cocoon:" redirects management : 
they're now handled internally by the TreeProcessor, which avoids 
external components to worry about it.

I'll test a bit more this before committing. But this makes one more 
reason for a quick 2.1.1 ;-)

Sylvain (going to bed after a successful bug hunt)

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com