Avoid NullPointerException in JULI FileHandler if formatter is misconfigured
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 21 Jun 2011 13:24:44 +0000 (13:24 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 21 Jun 2011 13:24:44 +0000 (13:24 +0000)
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

java/org/apache/juli/FileHandler.java
webapps/docs/changelog.xml

index f337d22..500a245 100644 (file)
@@ -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());
index e07367f..94d2595 100644 (file)
         multiple occurrences of elements that are only allowed to appear once in
         web.xml and web-fragment.xml. (kfujino)
       </fix>
+      <add>
+        <bug>51403</bug>: Avoid NPE in JULI FileHandler if formatter is
+        misconfigured. (kkolinko)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Coyote">