Bug 111355 - Log4j SMTP appender creates Null Pointer Exception
Summary: Log4j SMTP appender creates Null Pointer Exception
Status: RESOLVED WORKSFORME
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-03 13:00 EDT by Richard A. Gill CLA
Modified: 2007-02-16 05:12 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard A. Gill CLA 2005-10-03 13:00:20 EDT
When using the SMTPAppender in log4j, a null pointer is thrown on start-up. When
the appender-ref is taken out, all is well.


>java -jar camod.jar
log4j: Threshold ="all".
log4j: Rendering class: [mil.dtic.camod.etc.DynaBeanCollectionRenderer], Rendere
d class: [java.util.Collection].
log4j: Rendering class: [mil.dtic.camod.etc.DynaBeanRenderer], Rendered class: [
org.apache.commons.beanutils.DynaBean].
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [mil.dtic.camod.cron] additivity to [true].
log4j: Level value for mil.dtic.camod.cron is  [debug].
log4j: mil.dtic.camod.cron level set to DEBUG
log4j: Class name: [org.apache.log4j.DailyRollingFileAppender]
log4j: FB: Setting primary appender to [CRON].
log4j: FB: Adding logger [mil.dtic.camod.cron].
log4j: Class name: [org.apache.log4j.FileAppender]
log4j: Setting property [file] to [/tmp/camod.log].
log4j: Setting property [threshold] to [DEBUG].
log4j: Setting property [append] to [false].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%p %d{ISO8601} %m%n].
log4j: setFile called: /tmp/camod.log, false
log4j: setFile ended
log4j: FB: Setting backup appender to [FALLBACK].
log4j: Setting property [file] to [/logs/dticstinet/camod/camod.log].
log4j: Setting property [datePattern] to [.yyyy-MM-dd].
log4j: Setting property [threshold] to [DEBUG].
log4j: Setting property [append] to [true].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%p %d{ISO8601} %m%n].
log4j: setFile called: /logs/dticstinet/camod/camod.log, true
log4j: setFile ended
log4j: Appender [CRON] to be rolled at midnight.
log4j: Adding appender named [CRON] to category [mil.dtic.camod.cron].
log4j: Class name: [org.apache.log4j.net.SMTPAppender]
log4j: Setting property [SMTPHost] to [mails.dtic.mil].
log4j: Setting property [to] to [rgill.csc@dtic.mil].
log4j: Setting property [from] to [camod-local@dtic.mil].
log4j: Setting property [subject] to [CAMOD Error].
log4j: Parsing layout of class: "org.apache.log4j.HTMLLayout"
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
        at mil.dtic.camod.cron.aspects.TraceLoggingAspect.ajc$if_7(TraceLoggingA
spect.aj:41)
        at mil.dtic.camod.cron.util.CronProperties.getInstance(CronProperties.ja
va)
        at mil.dtic.camod.cron.CAModCron.<clinit>(CAModCron.java:55)
Comment 1 Richard A. Gill CLA 2006-02-10 10:08:41 EST
Application was packaged as a jar. Signing the jar solved the problem.
Comment 2 Sian January CLA 2006-03-07 08:43:15 EST
This looks like an error in a generated method (see ajc$if_7 below) so I'm passing the bug to the compiler.
Comment 3 Andrew Clement CLA 2006-03-07 08:49:47 EST
ajc$if methods are generated for any if() components of a pointcut.  Here it is the 7th if() encountered (hence ajc$if_7) - it looks like an NPE occurred in the expression that was specified in that if() - possibly a bug in the TraceLoggingAspect() - are we able to see the TraceLoggingAspect to verify??
Comment 4 Andrew Clement CLA 2007-02-16 05:12:50 EST
no updates in one year. please reopen and include what you can of the TraceLoggingAspect if it is still a problem.