Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.3.0-alpha5
-
None
-
jdk: 14
slf4j: 2.0.0-alpha1
logback: 1.3.0-alpha5
modularized application
Description
There is NPE by initializing of Logger:
org.slf4j.LoggerFactory.getLogger(getClass())
java.lang.NullPointerException: Cannot invoke "ch.qos.logback.core.model.processor.ModelHandlerBase.isSupportedModelType(ch.qos.logback.core.model.Model)" because "handler" is null 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)
It can be fixed with adding to the run configuration:
--add-opens ch.qos.logback.classic/ch.qos.logback.classic.model.processor=ch.qos.logback.core
Should this be defined in theĀ module-info of theĀ ch.qos.logback.classic?