[logback-dev] [JIRA] (LOGBACK-1491) NPE with Logback 1.3.0-alpha5 in application using module path

QOS.CH (JIRA) noreply-jira at qos.ch
Mon Nov 11 14:35:00 CET 2019


Patrice Kueny created LOGBACK-1491:
--------------------------------------

             Summary: NPE with Logback 1.3.0-alpha5 in application using module path
                 Key: LOGBACK-1491
                 URL: https://jira.qos.ch/browse/LOGBACK-1491
             Project: logback
          Issue Type: Bug
          Components: logback-core
    Affects Versions: 1.3.0-alpha5
         Environment: Windows 10 64 bits + AdoptOpenJDK JDK 13.0.0.3
Also with Ubuntu 14.0.4 LTS + zulu13.28.11-ca-jdk13.0.1-linux_amd64.deb
logback-classic-1.3.0-alpha5.jar
logback-core-1.3.0-alpha5.jar 
slf4j-api-2.0.0-alpha1.jar
Running java application with module path.
            Reporter: Patrice Kueny
            Assignee: Logback dev list


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 :
{quote}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)
{quote}
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.



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the logback-dev mailing list