cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: The cocoon protocol can not be used outside an environment
Date Sat, 07 May 2005 18:21:37 GMT
Max Larsson wrote:

> Hallo,
> i've a problem (see subject, which i could figure out
> how to solve.
> What i am doing in short is:
> Implementing a transformer (similar to cinclue) only that
> for ich request to another source i start thread, which process
> the source. The transformer continues to go through the
> sax events. At the endDocument method, the transformer waits
> for all launched threads and serializa their output into single
> stream of SAX events.
> The problem i get is that my threads calls:
> source = SourceUtil.getSource( 
> resource,configurationParameters,resourceParameters,resolver );
> which results in an MalformedURLExpetion with:
> The cocoon protocol can not be used outside an environment
> This actually goes down a call to the method
> CocoonComponentManager.getCurrentEnvironment();
> which returns null, thus the exception thrown.
> Now, why is that so? Why the sudden is the Env. null,
> or another question, how can i solve this?

Have a look at the cron block. It comes with a BackgroundEnvironment 
that is used to setup background threads so that they can use the cocoon 
protocol. Now you're right that automatically creating such an 
environment when none exists would be more convenient.


Sylvain Wallez                        Anyware Technologies  
Apache Software Foundation Member     Research & Technology Director

View raw message