From: kkolinko Date: Tue, 21 Jun 2011 13:24:44 +0000 (+0000) Subject: Avoid NullPointerException in JULI FileHandler if formatter is misconfigured X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c704feba2d9543c5e0a7ad4fef0b1a042a380613;p=tomcat7.0 Avoid NullPointerException in JULI FileHandler if formatter is misconfigured Fixes https://issues.apache.org/bugzilla/post_bug.cgi git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1137996 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/juli/FileHandler.java b/java/org/apache/juli/FileHandler.java index f337d22e1..500a245c3 100644 --- a/java/org/apache/juli/FileHandler.java +++ b/java/org/apache/juli/FileHandler.java @@ -327,7 +327,8 @@ public class FileHandler try { setFormatter((Formatter) cl.loadClass(formatterName).newInstance()); } catch (Exception e) { - // Ignore + // Ignore and fallback to defaults + setFormatter(new SimpleFormatter()); } } else { setFormatter(new SimpleFormatter()); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index e07367f16..94d25953a 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -112,6 +112,10 @@ multiple occurrences of elements that are only allowed to appear once in web.xml and web-fragment.xml. (kfujino) + + 51403: Avoid NPE in JULI FileHandler if formatter is + misconfigured. (kkolinko) +