Bug 16170 - NPE in XMLLayout
Summary: NPE in XMLLayout
Status: RESOLVED DUPLICATE of bug 11570
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Layout (show other bugs)
Version: 1.2
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2003-01-16 15:52 UTC by Vladimir Korenev
Modified: 2005-03-20 17:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Korenev 2003-01-16 15:52:14 UTC
I called 
logger.error(e.getMessage(), e);

When exception InvocationTargetException, the message is null, XMLLayout throws
a NPE. But AFAIK logger must not throw any exception anywhere.

        at org.apache.log4j.helpers.Transform.appendEscapingCDATA(Transform.java
        at org.apache.log4j.xml.XMLLayout.format(Unknown Source)
        at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:292)
        at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.ja
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)

        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders
        at org.apache.log4j.Category.callAppenders(Category.java:187)
        at org.apache.log4j.Category.forcedLog(Category.java:372)
        at org.apache.log4j.Category.error(Category.java:303)
        at ru.cboss.core.util.logging.impl.Log4jLogger.error(Log4jLogger.java:69
. . .
Comment 1 Ceki Gulcu 2003-02-18 16:46:05 UTC

*** This bug has been marked as a duplicate of 11570 ***