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

Unable to use JULHelper with Java Modules

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 1.4.4, 1.3.4
    • 1.4.1, 1.3.1
    • None
    • None

    Description

      When logback is running with Java Modules (JPMS) an attempt to use JULHelper by any code fails with the following error:

      Exception in thread "main" java.lang.IllegalAccessError: class ch.qos.logback.classic.jul.JULHelper (in module ch.qos.logback.classic) cannot access class java.util.logging.Level (in module java.logging) because module ch.qos.logback.classic does not read module java.logging
       at ch.qos.logback.classic@1.4.1/ch.qos.logback.classic.jul.JULHelper.asJULLevel(JULHelper.java:45)
       at com.github.agavrilov.logback@1.0-SNAPSHOT/com.github.agavrilov.logback.Main.main(Main.java:9)

      I noticed this while using LevelChangePropagator in my program.

      Most probably the logback.classic module is missing "requires java.logging" declaration in its module-info.java.

      You can execute the run.sh script from the repository below to reproduce the problem:

      https://github.com/agavrilov76/logback-jpms-bug

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            agavrilov Alexey Gavrilov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: