java.lang.NullPointerException

QOS.ch JIRA | Andrey P.Rybin | 9 years ago
  1. 0

    Joran shows no error in conf file, but SyslogAppender failed with NullPointerException (because prefixLayout == null). I think Joran should show a error or SyslogAppender should work. conf, java and log below: conf: <?xml version="1.0" encoding="UTF-8"?> <configuration debug="true"> <appender name="aSYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"> <SyslogHost>127.0.0.1</SyslogHost> <Facility>LOCAL7</Facility> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%d %p [%t] %c::%m%n</pattern> </layout> </appender> <root> <level value="TRACE"/> <appender-ref ref="aSYSLOG"/> </root> </configuration> java: public static void main(String[] a) { org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestLogback.class); log.warn("test"); ch.qos.logback.classic.util.LoggerStatusPrinter.printStatusInDefaultContext(); }//main log: 11:09:10,687 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SyslogAppender] 11:09:10,687 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [aSYSLOG] 11:09:10,796 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [aSYSLOG] from the object stack 11:09:10,796 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to TRACE 11:09:10,796 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [aSYSLOG] to Logger[root] 11:09:10,796 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration. 11:09:10,796 |-ERROR in ch.qos.logback.classic.net.SyslogAppender[aSYSLOG] - Appender [aSYSLOG] failed to append. java.lang.NullPointerException java.lang.NullPointerException at ch.qos.logback.classic.net.SyslogAppender.postProcess(SyslogAppender.java:81) at ch.qos.logback.core.net.SyslogAppenderBase.append(SyslogAppenderBase.java:62) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) at ch.qos.logback.classic.Logger.warn(Logger.java:712) at net.sf.apr.test.logback.TestLogback.main(TestLogback.java:7)

    QOS.ch JIRA | 9 years ago | Andrey P.Rybin
    java.lang.NullPointerException
  2. 0

    Joran shows no error in conf file, but SyslogAppender failed with NullPointerException (because prefixLayout == null). I think Joran should show a error or SyslogAppender should work. conf, java and log below: conf: <?xml version="1.0" encoding="UTF-8"?> <configuration debug="true"> <appender name="aSYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"> <SyslogHost>127.0.0.1</SyslogHost> <Facility>LOCAL7</Facility> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%d %p [%t] %c::%m%n</pattern> </layout> </appender> <root> <level value="TRACE"/> <appender-ref ref="aSYSLOG"/> </root> </configuration> java: public static void main(String[] a) { org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestLogback.class); log.warn("test"); ch.qos.logback.classic.util.LoggerStatusPrinter.printStatusInDefaultContext(); }//main log: 11:09:10,687 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SyslogAppender] 11:09:10,687 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [aSYSLOG] 11:09:10,796 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [aSYSLOG] from the object stack 11:09:10,796 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to TRACE 11:09:10,796 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [aSYSLOG] to Logger[root] 11:09:10,796 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration. 11:09:10,796 |-ERROR in ch.qos.logback.classic.net.SyslogAppender[aSYSLOG] - Appender [aSYSLOG] failed to append. java.lang.NullPointerException java.lang.NullPointerException at ch.qos.logback.classic.net.SyslogAppender.postProcess(SyslogAppender.java:81) at ch.qos.logback.core.net.SyslogAppenderBase.append(SyslogAppenderBase.java:62) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) at ch.qos.logback.classic.Logger.warn(Logger.java:712) at net.sf.apr.test.logback.TestLogback.main(TestLogback.java:7)

    QOS.ch JIRA | 9 years ago | Andrey P.Rybin
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at ch.qos.logback.classic.net.SyslogAppender.postProcess()
    2. Logback Classic Module
      SyslogAppender.postProcess
      1. ch.qos.logback.classic.net.SyslogAppender.postProcess(SyslogAppender.java:81)
      1 frame
    3. Logback Core Module
      AppenderAttachableImpl.appendLoopOnAppenders
      1. ch.qos.logback.core.net.SyslogAppenderBase.append(SyslogAppenderBase.java:62)
      2. ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81)
      3. ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
      3 frames
    4. Logback Classic Module
      Logger.warn
      1. ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282)
      2. ch.qos.logback.classic.Logger.callAppenders(Logger.java:266)
      3. ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487)
      4. ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479)
      5. ch.qos.logback.classic.Logger.warn(Logger.java:712)
      5 frames
    5. net.sf.apr
      TestLogback.main
      1. net.sf.apr.test.logback.TestLogback.main(TestLogback.java:7)
      1 frame