1
0

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
This commit is contained in:
Robert Burrell Donkin
2006-02-12 16:28:32 +00:00
parent b765938bfe
commit 4b315332db

View File

@@ -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();