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

NPE in StaticLoggerBinder

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 1.0.6
    • logback-classic
    • Java 1.6.0_33, Mac os x
      JUL-to-SLF4J 1.6.6

    Description

      I probably have a bad setup , but I get an NPE in a method that probably shouldn't. I have a Context Listener that is starting up the JUL-to-SLF4J bridge.

      Failed to instantiate SLF4J LoggerFactory
      Reported exception:
      java.lang.NullPointerException
      at org.slf4j.impl.StaticLoggerBinder.getLoggerFactoryClassStr(StaticLoggerBinder.java:111)
      at org.slf4j.LoggerFactory.reportActualBinding(LoggerFactory.java:256)
      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:130)
      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
      at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
      at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:191)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
      at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
      at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
      at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

      Another exception below:

      Failed to instantiate [ch.qos.logback.classic.LoggerContext]
      Reported exception:
      java.lang.ClassCircularityError: java/util/logging/LogRecord
      at org.slf4j.bridge.SLF4JBridgeHandler.getSLF4JLogger(SLF4JBridgeHandler.java:200)
      at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:289)
      at java.util.logging.Logger.log(Logger.java:478)
      at java.util.logging.Logger.doLog(Logger.java:500)
      at java.util.logging.Logger.logp(Logger.java:616)
      at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:165)
      at org.apache.juli.logging.DirectJDKLog.debug(DirectJDKLog.java:99)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1525)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
      at ch.qos.logback.core.spi.ContextAwareBase.addError(ContextAwareBase.java:104)
      at ch.qos.logback.core.joran.action.AppenderAction.begin(AppenderAction.java:80)
      at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276)
      at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148)
      at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130)
      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96)
      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55)
      at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
      at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
      at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
      at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54)
      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
      at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
      at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:191)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
      at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
      at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
      at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

      Attachments

        1. SLF4JBridgeListener.java
          0.6 kB
          Matt Bishop
        2. Slf4jJulBridgeListener.java_DEFERRED
          0.6 kB
          Ceki Gülcü

        Activity

          People

            ceki Ceki Gülcü
            mattbishop Matt Bishop
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: