From 4b315332dba819532c5902c55902ac90890a7cd6 Mon Sep 17 00:00:00 2001 From: Robert Burrell Donkin Date: Sun, 12 Feb 2006 16:28:32 +0000 Subject: [PATCH] Print classloader details when the class loaded is incompatible. Added comment suggesting fix. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@377199 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/commons/logging/LogFactory.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/java/org/apache/commons/logging/LogFactory.java b/src/java/org/apache/commons/logging/LogFactory.java index a891e34..12268ba 100644 --- a/src/java/org/apache/commons/logging/LogFactory.java +++ b/src/java/org/apache/commons/logging/LogFactory.java @@ -997,11 +997,23 @@ public abstract class LogFactory { "Loaded class " + logFactoryClass.getName() + " from classloader " + objectId(classLoader)); } else { + // + // This indicates a problem with the ClassLoader tree. + // An incompatible ClassLoader was used to load the + // implementation. + // As the same classes + // must be available in multiple class loaders, + // it is very likely that multiple JCL jars are present. + // The most likely fix for this + // problem is to remove the extra JCL jars from the + // ClassLoader hierarchy. + // logDiagnostic( "Factory class " + logFactoryClass.getName() + " loaded from classloader " + objectId(classLoader) + " does not extend '" + LogFactory.class.getName() + "' as loaded by this classloader."); + logHierarchy("[BAD CL TREE] ", classLoader); } return (LogFactory) logFactoryClass.newInstance();