cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Using CocoonBean in a CocoonServlet
Date Mon, 10 May 2004 21:45:38 GMT
Carsten Ziegeler wrote:

>Sylvain Wallez wrote:
>>Hi folks,
>>In one of our projects, we use CocoonBean in a CocoonServlet 
>>environment to dump a collection of generated documents on 
>>disk. Doing this, we encountered two problems:
>>- CocoonComponentManager.checkEnvironment barfs and throws an 
>>Exception since the servlet environment exists on the stack 
>>when the CocoonBean starts its processing.
>>  Obvious solution is to remove this test, as indicated in 
>>the method's comments.
>I would be happy if we could leave the check in. This is to
>find a bug that sits somewhere deep in the core of Cocoon and
>is very rarely to reproduce. I hope that there will be the
>day when someone is able to have a reproducable test case.
>Isn't there a better way?

Mmmh... the environment stack cannot be empty, since CocoonServlet is 
calling CocoonBean.

The only solution I can see so far, but which looks hacky, would be to 
push a special "marker environment" that would demarcate the 
CocoonServlet environment stack from that of the CocoonBean. We could 
then have checkEnvironment() test either an empty stack or that special 
marker environment.



Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message