[logback-dev] SLF4J+logback not working with JDK9 (Jigsaw) early access

Chris Newland cnewland at chrisnewland.com
Mon Oct 19 14:42:05 UTC 2015


Hi,

Just an FYI.

I've been doing early-access testing of JDK9b83 (project Jigsaw modular
build from https://jdk9.java.net/jigsaw/)

The first call to LoggerFactory.getLogger(Class clazz) fails with the
exception:

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.InternalError: unnamed package in named module java.base
    at
jdk.internal.misc.BuiltinClassLoader.definePackage(java.base at 9.0/BuiltinClassLoader.java:569)
    at
jdk.internal.misc.BootLoader.definePackage(java.base at 9.0/BootLoader.java:123)
    at java.lang.Class.getPackage(java.base at 9.0/Class.java:917)
    at
ch.qos.logback.core.joran.util.StringToObjectConverter.canBeBuiltFromSimpleString(StringToObjectConverter.java:34)
    at
ch.qos.logback.core.joran.util.PropertySetter.computeRawAggregationType(PropertySetter.java:233)
    at
ch.qos.logback.core.joran.util.PropertySetter.computeAggregationType(PropertySetter.java:194)
    at
ch.qos.logback.core.joran.action.NestedComplexPropertyIA.isApplicable(NestedComplexPropertyIA.java:61)
    at
ch.qos.logback.core.joran.spi.Interpreter.lookupImplicitAction(Interpreter.java:237)
    at
ch.qos.logback.core.joran.spi.Interpreter.getApplicableActionList(Interpreter.java:256)
    at
ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:144)
    at
ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:129)
    at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
    at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
    at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
    at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
    at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
    at
ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
    at
ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152)
    at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
    at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:141)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304)
    at org.adoptopenjdk.jitwatch.ui.JITWatchUI.<clinit>(JITWatchUI.java:86)
    at org.adoptopenjdk.jitwatch.launch.LaunchUI.main(LaunchUI.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base at 9.0/Native
Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(java.base at 9.0/NativeMethodAccessorImpl.java:62)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base at 9.0/DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(java.base at 9.0/Method.java:530)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
    at java.lang.Thread.run(java.base at 9.0/Thread.java:746)

The program continues but there is no log output.

This is with

slf4j-api-1.7.7.jar
logback-classic-1.1.2.jar
logback-core-1.1.2.jar

If I remove the logback jars and replace with slf4j-jdk14-1.7.12.jar then
it works fine.

Cheers,

Chris




More information about the logback-dev mailing list