Bug 16170 - NPE in XMLLayout
NPE in XMLLayout
Status: RESOLVED DUPLICATE of bug 11570
Product: Log4j
Classification: Unclassified
Component: Layout
1.2
PC All
: P3 normal
: ---
Assigned To: log4j-dev
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2003-01-16 15:52 UTC by Vladimir Korenev
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

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.

java.lang.NullPointerException
        at org.apache.log4j.helpers.Transform.appendEscapingCDATA(Transform.java
:74)
        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
va:225)
        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
(AppenderAttachableImpl.java:57)
        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 ***