Repository: logging-log4j2 Updated Branches: refs/heads/master f64a150ac -> 61b419dd6
[LOG4J2-1051] NoClassDefFoundError when starting app on Google App Engine. Catch NoClassDefFoundError and rethrow as IAE. On platforms like Google App Engine and Android, some JRE classes are not supported: JMX, JNDI, etc. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1ab49465 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1ab49465 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1ab49465 Branch: refs/heads/master Commit: 1ab494651e3ebcaa292fd1ac395054043f69837a Parents: 4fba3c4 Author: Gary Gregory <[email protected]> Authored: Thu Jun 11 23:36:05 2015 -0700 Committer: Gary Gregory <[email protected]> Committed: Thu Jun 11 23:36:05 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/core/util/ReflectionUtil.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1ab49465/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java index 70d6df1..06335e3 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java @@ -184,6 +184,10 @@ public final class ReflectionUtil { final Constructor<T> constructor = getDefaultConstructor(clazz); try { return constructor.newInstance(); + } catch (final NoClassDefFoundError e) { + // LOG4J2-1051 + // On platforms like Google App Engine and Android, some JRE classes are not supported: JMX, JNDI, etc. + throw new IllegalArgumentException(e); } catch (final InstantiationException e) { throw new IllegalArgumentException(e); } catch (final IllegalAccessException e) {
