camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

[JDK25] JDKSpecific$ThreadAccess - IllegalAccessError: module java.base does not open java.lang to unnamed module

Open apupier opened this issue 2 months ago • 3 comments

Description

even if it is causing failure, there is this kind of stacktrace all over the test log:

2025-10-24 10:46:50,060 ERROR [org.jbo.exe.uncaught] (executor-thread-2) Thread Thread[#349,executor-thread-2,5,] threw an uncaught exception [Error Occurred After Shutdown]: java.lang.IllegalAccessError: module java.base does not open java.lang to unnamed module @64a489bc; to use the thread-local-reset capability on Java 24 or later, use this JVM option: --add-opens java.base/java.lang=ALL-UNNAMED
	at org.jboss.threads.JDKSpecific$ThreadAccess.<clinit>(JDKSpecific.java:32)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:13)
	at java.base/java.lang.Thread.run(Thread.java:1474)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
2025-10-24 10:47:33,889 INFO  [io.quarkus] (Quarkus Main Thread) camel-quarkus-core-deployment stopped in 0.031s
Exception in thread "executor-thread-1" java.lang.IllegalAccessError: module java.base does not open java.lang to unnamed module @7a5d0044; to use the thread-local-reset capability on Java 24 or later, use this JVM option: --add-opens java.base/java.lang=ALL-UNNAMED
	at org.jboss.threads.JDKSpecific$ThreadAccess.<clinit>(JDKSpecific.java:32)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:13)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Exception in thread "vert.x-internal-blocking-1" java.lang.NoClassDefFoundError: Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:13)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: module java.base does not open java.lang to unnamed module @7a5d0044; to use the thread-local-reset capability on Java 24 or later, use this JVM option: --add-opens java.base/java.lang=ALL-UNNAMED [in thread "executor-thread-1"]
	at org.jboss.threads.JDKSpecific$ThreadAccess.<clinit>(JDKSpecific.java:32)
	... 3 more

apupier avatar Oct 24 '25 09:10 apupier

You'll see this everywhere with JDK25. It's known issue with JBoss Threads that Quarkus is aware of.

jamesnetherton avatar Oct 24 '25 09:10 jamesnetherton

in fact, seems it is causing some test failure:

[[1;31mERROR[m] [1;31mErrors: [m
[[1;31mERROR[m] [1;31m  GroupedAwsSecretsManagerTest.testOperations » IllegalAccess module java.base does not open java.lang to unnamed module @6c2a7c73; to use the thread-local-reset capability on Java 24 or later, use this JVM option: --add-opens java.base/java.lang=ALL-UNNAMED[m
[[1;31mERROR[m] [1;31m  GroupedAws2LambdaTest.performingOperationsOnLambdaFunctionShouldSucceed » NoClassDefFound Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
Error:    ContinuousDevTest.checkTests » NoClassDefFound Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
Error:    DoubleRoutesTest.checkTests » NoClassDefFound Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
Error:    ProducedRouteBuilderTest.checkTests » IllegalAccess module java.base does not open java.lang to unnamed module @7ac2d378; to use the thread-local-reset capability on Java 24 or later, use this JVM option: --add-opens java.base/java.lang=ALL-UNNAMED
Error:    RouteBuilderFailureTest.checkTests » NoClassDefFound Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
Error:    RouteBuilderWarningWithProducedBuilderTest.checkTests » NoClassDefFound Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
Error:    RouteBuilderWarningWithoutProducedBuilderTest.checkTests » NoClassDefFound Could not initialize class org.jboss.threads.JDKSpecific$ThreadAccess
CamelMainRoutesIncludePatternWithAbsoluteFilePrefixDevModeTest.testRoutesDiscovery	
CamelMainRoutesIncludePatternWithClasspathPrefixDevModeTest.testRoutesDiscovery	
CamelMainRoutesIncludePatternWithNoPrefixDevModeTest.testRoutesDiscovery

apupier avatar Oct 24 '25 09:10 apupier

sounds a large and complicated issue, see https://github.com/quarkusio/quarkus/discussions/51041

apupier avatar Nov 19 '25 14:11 apupier