Bug 35239 - NullPointerException when saving displayed events
Summary: NullPointerException when saving displayed events
Status: NEEDINFO
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: chainsaw (show other bugs)
Version: 1.3alpha
Hardware: PC Windows 2000
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-06 14:58 UTC by David Rudloff
Modified: 2006-11-11 10:11 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Rudloff 2005-06-06 14:58:57 UTC
On chainsaw-bundle (1.3.alpha7), I defined a LogFilePatternReceiver for a file
containing the following line:
<<
[02.11.14 10:55:46:743 CET] 14d0798 AdminServer   A ADMS0002I: Initializing
WebSphere Administration server
>>

The receiver has the following definition:
  <plugin name="logfile" class="org.apache.log4j.varia.LogFilePatternReceiver">
    <param name="timestampFormat" value="yy.MM.dd HH:mm:ss:SSS"/>
    <param name="logFormat" value="[TIMESTAMP *] * LOGGER CLASS: MESSAGE"/>
    <param name="fileURL" value="file:///E:/trace.log"/>
    <param name="tailing" value="true"/>
     <param name="name" value="tracefile"/>
</plugin >

When trying the "Save as" action, the following exception occurs and the action
fails:
<<
java.lang.NullPointerException
        at java.io.Writer.write(Writer.java:126)
        at org.apache.log4j.xml.XMLLayout.format(XMLLayout.java:191)
        at org.apache.log4j.Layout.format(Layout.java:57)
        at
org.apache.log4j.chainsaw.FileSaveAction.actionPerformed(FileSaveAction.java:110)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
)        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
        at java.awt.Component.processMouseEvent(Component.java:5100)
>>

It seems that in this case the parser sets the null value to some fields instead
of the "?" value.
Any workaround ?
Comment 1 Kay Abendroth 2006-11-11 10:11:24 UTC
I cannot reproduce this bug with 1.99.99.
Can you test it with the latest chainsaw version and reply to this bug-report?