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

ServiceConfigurationError: module ch.qos.logback.classic does not declare `uses`

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 1.3.0-alpha3
    • 1.3.0-alpha1
    • logback-classic
    • None

    Description

      On attempting to call LoggerFactory.getLogger(), the package raises the following exception:

      Exception in thread "main" java.util.ServiceConfigurationError: ch.qos.logback.classic.spi.Configurator: module ch.qos.logback.classic does not declare `uses`
      	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
      	at java.base/java.util.ServiceLoader.checkCaller(ServiceLoader.java:574)
      	at java.base/java.util.ServiceLoader.<init>(ServiceLoader.java:503)
      	at java.base/java.util.ServiceLoader.load(ServiceLoader.java:1639)
      	at ch.qos.logback.classic/ch.qos.logback.classic.util.EnvUtil.loadFromServiceLoader(EnvUtil.java:48)
      	at ch.qos.logback.classic/ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:155)
      	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:153)
      	at org.slf4j/org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:141)
      	at org.slf4j/org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:419)
      	at org.slf4j/org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:405)
      	at org.slf4j/org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:354)
      	at org.slf4j/org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:380)
      	at com.io7m.bugs.logback/com.io7m.bugs.logback.Main.<clinit>(Main.java:8)
      

      There's a trivial repro case here:

      https://github.com/io7m/logback-bug-20180209

      Attachments

        Activity

          People

            logback-dev Logback dev list
            io7m Mark Raynsford
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: