Community
Participate
Working Groups
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)
Application was packaged as a jar. Signing the jar solved the problem.
This looks like an error in a generated method (see ajc$if_7 below) so I'm passing the bug to the compiler.
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??
no updates in one year. please reopen and include what you can of the TraceLoggingAspect if it is still a problem.