You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2014/12/01 06:21:27 UTC

logging-log4j2 git commit: [LOG4J2-834] ThrowableProxy throws NoClassDefFoundError.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 5f429f79e -> d3989b40f


[LOG4J2-834] ThrowableProxy throws NoClassDefFoundError.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d3989b40
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d3989b40
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d3989b40

Branch: refs/heads/master
Commit: d3989b40f92cdf2a7a0bc8a8d4d883386a640ebb
Parents: 5f429f7
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Dec 1 00:21:18 2014 -0500
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Dec 1 00:21:18 2014 -0500

----------------------------------------------------------------------
 .../logging/log4j/core/impl/ThrowableProxy.java   | 18 +++++++++++++-----
 src/changes/changes.xml                           |  4 ++--
 2 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3989b40/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
index 75c8564..3aadf6c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
@@ -451,15 +451,23 @@ public class ThrowableProxy implements Serializable {
         try {
             clazz = Loader.loadClass(className);
         } catch (final ClassNotFoundException ignored) {
-            try {
-                clazz = Loader.initializeClass(className, this.getClass().getClassLoader());
-            } catch (final ClassNotFoundException ignore) {
-                return null;
-            }
+            return initializeClass(className);
+        } catch (final NoClassDefFoundError ignored) {
+            return initializeClass(className);
         }
         return clazz;
     }
 
+    private Class<?> initializeClass(final String className) {
+        try {
+            return Loader.initializeClass(className, this.getClass().getClassLoader());
+        } catch (final ClassNotFoundException ignore) {
+            return null;
+        } catch (final NoClassDefFoundError ignore) {
+            return null;
+        }
+    }
+
     /**
      * Construct the CacheEntry from the Class's information.
      * 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d3989b40/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1f884b9..bdf9375 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -35,8 +35,8 @@
       <action issue="LOG4J2-903" dev="ggregory" type="fix" due-to="Mauro Molinari">
         ClassLoaderContextSelector uses ClassLoader.toString() as a key
       </action>
-      <action issue="LOG4J2-834" dev="ggregory" type="fix">
-        NoClassDefFoundError in ThrowableProxy.
+      <action issue="LOG4J2-834" dev="ggregory" type="fix" due-to="Nikita Koval, Leonard Broman, Thiago Kronig">
+        ThrowableProxy throws NoClassDefFoundError.
       </action>
       <action issue="LOG4J2-893" dev="ggregory" type="fix">
         NullPointerException on filter when mapping JUL to Log4j2.