Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 39444 invoked from network); 24 May 2007 15:37:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 May 2007 15:37:51 -0000 Received: (qmail 59255 invoked by uid 500); 24 May 2007 15:37:44 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 59114 invoked by uid 500); 24 May 2007 15:37:44 -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 List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 59041 invoked by uid 99); 24 May 2007 15:37:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2007 08:37:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2007 08:37:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9921D714058 for ; Thu, 24 May 2007 08:37:16 -0700 (PDT) Message-ID: <7588442.1180021036623.JavaMail.jira@brutus> Date: Thu, 24 May 2007 08:37:16 -0700 (PDT) From: "Carsten Ziegeler (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON-2068) Add failover for loading classes. In-Reply-To: <25879943.1180015157751.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COCOON-2068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498683 ] Carsten Ziegeler commented on COCOON-2068: ------------------------------------------ I'm not quiet sure, but you could perhaps set the thread context class loader to the class loader you need. Cocoon itself uses the thread context class loader in all places, so if you set this before you call Cocoon, it should work i think. > Add failover for loading classes. > --------------------------------- > > Key: COCOON-2068 > URL: https://issues.apache.org/jira/browse/COCOON-2068 > Project: Cocoon > Issue Type: Improvement > Components: * Cocoon Core > Affects Versions: 2.1.10 > Reporter: solprovider > Priority: Minor > > The ClassLoader from currentThread.getContextClassLoader() was unable to retrieve classes in my environment. Add fallback to standard Java class loading. > NOTE: The two "set" lines would work in either order. I believe Cocoon is using a custom ClassLoader to dynamically load changes so the custom method must be tried first. (The auto-reload ability will be lost for environments using the fallback, but at least they will be able to use Cocoon.) > public class ClassUtils{ > public static Class loadClass(String className) throws ClassNotFoundException{ > Class ret; > try{ > ret= ClassUtils.getClassLoader().loadClass(className); > }catch(ClassNotFoundException e){ > ret= Class.forName(className); > } > return ret; > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.