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

NPE with Logback 1.3.0-alpha5 in application using module path

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.0-alpha6, 1.3.0-alpha7
    • 1.3.0-alpha5
    • logback-core
    • None

    Description

      When running a modular application (with module path) with version 1.3.0-alpha5 of Logback-Classic, I obtain a NullPointerException at the first call to LoggerFactory.getLogger.

      I had no such problem with the 1.3.0-alpha4 version of Logback-Classic. The problem disappears also if I run the same application in non-modular mode (using the classpath).

      Below is the stack trace :

      Failed to instantiate [ch.qos.logback.classic.LoggerContext]
      Reported exception:
      java.lang.NullPointerException
              at ch.qos.logback.core/ch.qos.logback.core.model.processor.DefaultProcessor.traverse(DefaultProcessor.java:114)
              at ch.qos.logback.core/ch.qos.logback.core.model.processor.DefaultProcessor.traversalLoop(DefaultProcessor.java:39)
              at ch.qos.logback.core/ch.qos.logback.core.model.processor.DefaultProcessor.process(DefaultProcessor.java:54)
              at ch.qos.logback.core/ch.qos.logback.core.joran.GenericConfigurator.processModel(GenericConfigurator.java:178)
              at ch.qos.logback.core/ch.qos.logback.core.joran.GenericConfigurator.playEventsAndProcessModel(GenericConfigurator.java:165)
              at ch.qos.logback.core/ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:151)
              at ch.qos.logback.core/ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:115)
              at ch.qos.logback.core/ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:58)
              at ch.qos.logback.classic/ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:82)
              at ch.qos.logback.classic/ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:157)
              at ch.qos.logback.classic/ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:49)
              at ch.qos.logback.classic/ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:40)
              at org.slf4j/org.slf4j.LoggerFactory.bind(LoggerFactory.java:152)
              at org.slf4j/org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139)
              at org.slf4j/org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:418)
              at org.slf4j/org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:404)
              at org.slf4j/org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:353)
              at org.slf4j/org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:379)
              at fr.kueny.patrice.lab/fr.kueny.patrice.lab.ihm.LabStarter.<init>(LabStarter.java:57)
              at fr.kueny.patrice.lab/fr.kueny.patrice.lab.ihm.LabStarter.main(LabStarter.java:46)

      The problem seems not related to the content of the logback.xml file because I obtain the same result with the default logback.xml file (logback-examples/src/main/resources/chapters/configuration/sample0.xml).

      The problem seems to be related to the method ch.qos.logback.core.joran.GenericConfigurator::playEventsAndProcessModel  introduced in the 1.3.0-alpha5 version. I suspect a violation of java modules access rights.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            pk960 Patrice Kueny
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: