Bug 51403 - Avoid NullPointerException in JULI FileHandler if formatter is misconfigured
Avoid NullPointerException in JULI FileHandler if formatter is misconfigured
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.16
PC Windows XP
: P2 enhancement (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-06-21 13:13 UTC by Konstantin Kolinko
Modified: 2011-07-11 14:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2011-06-21 13:13:00 UTC
If formatter assigned to org.apache.juli.FileHandler in logging.properties is misconfigured and fails to load,
the FileHandler starts without formatter and fails with an NPE later.

To reproduce: assign some bogus value to
1catalina.org.apache.juli.FileHandler.formatter

When Tomcat starts, the following will be printed at the console:

java.util.logging.ErrorManager: 4
java.lang.NullPointerException
        at org.apache.juli.FileHandler.openWriter(FileHandler.java:377)
        at org.apache.juli.FileHandler.<init>(FileHandler.java:99)
        at org.apache.juli.FileHandler.<init>(FileHandler.java:90)


I think we can be more tolerant to this configuration error and fall back to the default formatter. I will commit a fix shortly.
Comment 1 Konstantin Kolinko 2011-06-21 13:27:56 UTC
Fixed in 7.0 with r1137996, will be in 7.0.17.
Proposed for 6.0 and 5.5.
Comment 2 Konstantin Kolinko 2011-07-11 14:20:59 UTC
Fixed in 6.0 in r1145188 and will be in 6.0.33