Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-438

IllegalAccessError in MDC when using Java 10

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.7.25, 1.8.0-beta2
    • None
    • None
    • Java 10

      slf4j-api-1.7.25

      slf4j-log4j12-1.7.25

    Description

      When using MDC and log4j I get an IllegalAccessError during initialization.

      java.lang.IllegalAccessError: tried to access field org.apache.log4j.MDC.mdc from class org.apache.log4j.MDCFriend
              at org.apache.log4j.MDCFriend.fixForJava9(MDCFriend.java:11)
              at org.slf4j.impl.Log4jMDCAdapter.<clinit>(Log4jMDCAdapter.java:38)
              at org.slf4j.impl.StaticMDCBinder.getMDCA(StaticMDCBinder.java:59)
              at org.slf4j.MDC.bwCompatibleGetMDCAdapterFromBinder(MDC.java:99)
              at org.slf4j.MDC.<clinit>(MDC.java:108)
      

       I guess package private fields are not accessible between different jar-files anymore in Java 10. Or am I doing something wrong?

       

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            bergander Andreas Bergander
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: