cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Re: multithreaded Content Aggregator migration from 2.1 to 2.2
Date Wed, 04 Jun 2008 22:54:23 GMT
Imran Pariyani pisze:
> Hi

Hi Imran,

> last night i wasted 5 hrs overs this without any success .. i guess it 
> has something to do with passing the RequestContextListener to the 
> spring context .. i have initialized the listener in my web.xml and also 
> added the config in applicationcontext.xml .. i checked everything on my 
> end .. everything seems to be fine .. is something wrong with the 
> cachemanager present in cocoon ?
> any help will be greatly appreciated !! ..

Unfortunately, it looks like you stumbled across rather complicated (and obscure) bug. It's
to the fact how Spring's request scope works (objects are tied to the thread). If you run

multithreaded aggregation then child threads don't have an access to beans defined with 'request'

scope because they are visible only in parent thread.

More details below...


>> org.apache.cocoon.components.source.impl.SitemapSource.toSAX(

The failing code is:
             if (touchedOM) {
                 //Because of complicated flow of this source it must maintain the cleaness
of OM on 
its own
                 ObjectModel newObjectModel;
                 try {
                     newObjectModel = (ObjectModel)manager.lookup(ObjectModel.ROLE);
                 } catch (ServiceException e) {
                     throw new SAXException("Couldn't look up Object Model", e);
                 touchedOM = false;
Here, manager.lookup fails because ObjectModel is a bean with request scope.

To be honest, I don't have an idea how this should be fixed. I guess it's a bug of CocoonRunnable

class but I don't know how to give child threads access to parent thread variables in a safe

This would require more investigation that I have no time for at the moment, unfortunately.

I hope it helped you a little to understand the problem. Maybe you will find someone on dev@
list that has an idea how to fix it.

Grzegorz Kossakowski

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message