[logback-dev] [JIRA] Resolved: (LBCORE-193) ERROR in ch.qos.logback.core.joran.spi.Interpreter at 8:19 - RuntimeException in Action for tag [encoder] java.lang.NullPointerException

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Thu Feb 10 13:17:52 CET 2011


     [ http://jira.qos.ch/browse/LBCORE-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceki Gulcu resolved LBCORE-193.
-------------------------------

    Fix Version/s: unspecified
       Resolution: Fixed

Contrary to what the documentation says, the opening parenthesis  has to be escaped as well. 

Documentation as well as logback's internal handling of this case were were improved in [1].

[1] http://github.com/ceki/logback/commit/4373dfaaa5266


> ERROR in ch.qos.logback.core.joran.spi.Interpreter at 8:19 - RuntimeException in Action for tag [encoder] java.lang.NullPointerException
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LBCORE-193
>                 URL: http://jira.qos.ch/browse/LBCORE-193
>             Project: logback-core
>          Issue Type: Bug
>          Components: Joran
>    Affects Versions: 0.9.27
>            Reporter: B. K. Oxley (binkley)
>            Assignee: Ceki Gulcu
>            Priority: Critical
>             Fix For: unspecified
>
>
> 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 at 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 at 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list