Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 7961 invoked from network); 7 May 2005 18:21:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 May 2005 18:21:46 -0000 Received: (qmail 51567 invoked by uid 500); 7 May 2005 18:24:38 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 51496 invoked by uid 500); 7 May 2005 18:24:38 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 51473 invoked by uid 99); 7 May 2005 18:24:38 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from postfix4-1.free.fr (HELO postfix4-1.free.fr) (213.228.0.62) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 07 May 2005 11:24:38 -0700 Received: from [192.168.0.100] (lns-vlq-39f-81-56-134-235.adsl.proxad.net [81.56.134.235]) by postfix4-1.free.fr (Postfix) with ESMTP id 6C01C31795B for ; Sat, 7 May 2005 20:21:38 +0200 (CEST) Message-ID: <427D0731.8050902@apache.org> Date: Sat, 07 May 2005 20:21:37 +0200 From: Sylvain Wallez Organization: Anyware Technologies User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: The cocoon protocol can not be used outside an environment References: <427CD070.6090308@abz-informatik.de> In-Reply-To: <427CD070.6090308@abz-informatik.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 -- Sylvain Wallez Anyware Technologies http://apache.org/~sylvain http://anyware-tech.com Apache Software Foundation Member Research & Technology Director