From ca0188c41e5fe63117adae957e58ea06cef2a034 Mon Sep 17 00:00:00 2001 From: Simon Kitching Date: Mon, 6 Jun 2005 10:33:37 +0000 Subject: [PATCH] Fix bug introduced by recent changes. Thanks to Brian Stansberry for the patch. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@180287 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/logging/impl/LogFactoryImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java b/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java index cea732e..e164989 100644 --- a/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java +++ b/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java @@ -722,7 +722,16 @@ public class LogFactoryImpl extends LogFactory { logAdapterClass = loadClass(logAdapterClassName); constructor = logAdapterClass.getConstructor(logConstructorSignature); logAdapter = (Log) constructor.newInstance(params); - } catch (NoClassDefFoundError e) { + } catch (ClassNotFoundException e) { + // We were unable to find the log adapter + String msg = "" + e.getMessage(); + logDiagnostic( + "The log adapter " + + logAdapterClassName + + " is not available: " + + msg.trim()); + return null; + } catch (NoClassDefFoundError e) { // We were able to load the adapter but it had references to // other classes that could not be found. This simply means that // the underlying logger library could not be found.