Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10831

o.a.s.commons.thread fails setting up ThreadLocal cleaner on Java 17

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • Commons Threads 3.3.2
    • Commons
    • None

    Description

      When running the Sling Starter with Java 17, the following messages come up:

      21.09.2021 11:13:54.247 *WARN* [sling-default-1] org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals Could not set up thread local cleaner (most probably not a compliant JRE): {}
      java.lang.ExceptionInInitializerError: null
              at org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.beforeExecute(ThreadPoolExecutorCleaningThreadLocals.java:58) [org.apache.sling.commons.threads:3.2.20]
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals accessible: module java.base does not "opens java.lang" to unnamed module @6e04bc96
              at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
              at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
              at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
              at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
              at org.apache.sling.commons.threads.impl.ThreadLocalCleaner.field(ThreadLocalCleaner.java:77) [org.apache.sling.commons.threads:3.2.20]
              at org.apache.sling.commons.threads.impl.ThreadLocalCleaner.<clinit>(ThreadLocalCleaner.java:54) [org.apache.sling.commons.threads:3.2.20]
              ... 4 common frames omitted
      21.09.2021 11:13:54.248 *ERROR* [sling-default-1] org.apache.sling.extensions.threaddump.internal.Activator Uncaught exception in Thread Thread[sling-default-1,5,main]
      java.lang.ExceptionInInitializerError: null
              at org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.beforeExecute(ThreadPoolExecutorCleaningThreadLocals.java:58) [org.apache.sling.commons.threads:3.2.20]
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field java.lang.ThreadLocal$ThreadLocalMap java.lang.Thread.threadLocals accessible: module java.base does not "opens java.lang" to unnamed module @6e04bc96
              at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
              at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
              at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
              at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
              at org.apache.sling.commons.threads.impl.ThreadLocalCleaner.field(ThreadLocalCleaner.java:77) [org.apache.sling.commons.threads:3.2.20]
              at org.apache.sling.commons.threads.impl.ThreadLocalCleaner.<clinit>(ThreadLocalCleaner.java:54) [org.apache.sling.commons.threads:3.2.20]
              ... 4 common frames omitted
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rombert Robert Munteanu
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: