Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 64823 invoked by uid 500); 8 Jan 2003 14:08:07 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 64808 invoked by uid 500); 8 Jan 2003 14:08:06 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 8 Jan 2003 14:08:06 -0000 Message-ID: <20030108140806.93271.qmail@icarus.apache.org> From: sylvain@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/source/impl ContextSourceFactory.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N sylvain 2003/01/08 06:08:05 Modified: src/java/org/apache/cocoon/components/source/impl ContextSourceFactory.java Log: Fix endless loop Revision Changes Path 1.8 +14 -2 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/ContextSourceFactory.java Index: ContextSourceFactory.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/ContextSourceFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ContextSourceFactory.java 8 Jan 2003 11:04:53 -0000 1.7 +++ ContextSourceFactory.java 8 Jan 2003 14:08:05 -0000 1.8 @@ -99,7 +99,10 @@ */ public void compose(ComponentManager manager) throws ComponentException { this.manager = manager; - this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE); + // FIXME : Looking up the resolver here leads to an infinite loop + // (is this because of Avalon or CocoonComponentManager ??) + // So we delay this for to the first call to getSource(). + //this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE); } /** @@ -132,6 +135,15 @@ this.getLogger().debug( "Creating source object for " + location ); } + // Lookup resolver if needed + if (this.resolver == null) { + try { + this.resolver = (SourceResolver)this.manager.lookup( SourceResolver.ROLE ); + } catch (ComponentException ce) { + throw new SourceException("Unable to lookup source resolver.", ce); + } + } + // Remove the protocol and the first '/' int pos = location.indexOf(":/"); String path = location.substring(pos+1); ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org