Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-111

ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:19 - RuntimeException in Action for tag [encoder] java.lang.NullPointerException

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • None
    • None
    • logback-core
    • None

    Description

      I get an NPE parsing the below logback.xml when upgrading from 0.9.26 to 0.9.27:

      <configuration debug="${log.debug:-false}">
      <property resource="configuration.properties"/>

      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>%date %level [%thread] %logger(%file:%line\) - %msg%n
      </pattern>
      </encoder>
      </appender>

      <logger name="scratch" level="${log.level:-INFO}"/>

      <root level="${log-all.level:-WARN}">
      <appender-ref ref="STDOUT"/>
      </root>
      </configuration>

      09:12:58,914 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
      09:12:58,914 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
      09:12:58,914 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at file:/C:/cygwin/home/boxley/src/scratch/target/classes/logback.xml
      09:12:58,976 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
      09:12:58,976 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
      09:12:58,992 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
      09:12:59,008 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:19 - RuntimeException in Action for tag [encoder] java.lang.NullPointerException
      at java.lang.NullPointerException
      at at ch.qos.logback.core.pattern.parser.Parser.COMPOSITE(Parser.java:196)
      at at ch.qos.logback.core.pattern.parser.Parser.C(Parser.java:164)
      at at ch.qos.logback.core.pattern.parser.Parser.T(Parser.java:142)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:97)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.parse(Parser.java:92)
      at at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:83)
      at at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:27)
      at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167)
      at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:315)
      at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:194)
      at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:180)
      at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:52)
      at at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:332)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:126)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:93)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:52)
      at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
      at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
      at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
      at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
      at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
      at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
      at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
      at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
      at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
      at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
      at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
      at at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:160)
      at at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:89)
      at at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:59)
      at at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
      at at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
      at at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
      at at scratch.spring.MynsMain.main(MynsMain.java:18)
      at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at at java.lang.reflect.Method.invoke(Method.java:597)
      at at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
      09:12:59,008 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Encoder has not been set. Cannot invoke its init method.
      09:12:59,008 |-ERROR in ch.qos.logback.core.ConsoleAppender[STDOUT] - No encoder set for the appender named "STDOUT".
      09:12:59,008 |-WARN in ch.qos.logback.core.joran.action.AppenderAction - The object at the of the stack is not the appender named [STDOUT] pushed earlier.
      09:12:59,008 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [scratch] to INFO
      09:12:59,008 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
      09:12:59,008 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
      09:12:59,008 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.

      09:12:58,914 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
      09:12:58,914 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
      09:12:58,914 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at file:/C:/cygwin/home/boxley/src/scratch/target/classes/logback.xml
      09:12:58,976 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
      09:12:58,976 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
      09:12:58,992 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
      09:12:59,008 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:19 - RuntimeException in Action for tag [encoder] java.lang.NullPointerException
      at java.lang.NullPointerException
      at at ch.qos.logback.core.pattern.parser.Parser.COMPOSITE(Parser.java:196)
      at at ch.qos.logback.core.pattern.parser.Parser.C(Parser.java:164)
      at at ch.qos.logback.core.pattern.parser.Parser.T(Parser.java:142)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:97)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.Eopt(Parser.java:116)
      at at ch.qos.logback.core.pattern.parser.Parser.E(Parser.java:101)
      at at ch.qos.logback.core.pattern.parser.Parser.parse(Parser.java:92)
      at at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:83)
      at at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:27)
      at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:167)
      at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:315)
      at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:194)
      at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:180)
      at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:52)
      at at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:332)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:126)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:93)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:52)
      at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
      at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
      at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
      at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
      at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
      at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
      at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
      at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
      at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
      at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
      at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
      at at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:160)
      at at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:89)
      at at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:59)
      at at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
      at at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
      at at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
      at at scratch.spring.MynsMain.main(MynsMain.java:18)
      at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at at java.lang.reflect.Method.invoke(Method.java:597)
      at at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
      09:12:59,008 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Encoder has not been set. Cannot invoke its init method.
      09:12:59,008 |-ERROR in ch.qos.logback.core.ConsoleAppender[STDOUT] - No encoder set for the appender named "STDOUT".
      09:12:59,008 |-WARN in ch.qos.logback.core.joran.action.AppenderAction - The object at the of the stack is not the appender named [STDOUT] pushed earlier.
      09:12:59,008 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [scratch] to INFO
      09:12:59,008 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
      09:12:59,008 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
      09:12:59,008 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            binkley B. K. Oxley (binkley)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: