JBoss EAP 8.0 startup fails with `InaccessibleObjectException` and `NoClassDefFoundError` on JDK 21 when `PRESERVE_JAVA_OPTS=true` is set

Solution Unverified - Updated -

Issue

  • When starting JBoss EAP 8.0 on JDK 21 with the environment variable PRESERVE_JAVA_OPTS=true set, the process fails and the server.log file shows multiple errors.
  • The errors include java.lang.reflect.InaccessibleObjectException and java.lang.NoClassDefFoundError: Could not initialize class org.wildfly.clustering.marshalling.protostream.util.UtilMarshallerProvider.
  • A specific error message is: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Class java.util.EnumMap.keyType accessible: module java.base does not "opens java.util" to unnamed module.
  • Adding the JVM option --add-opens java.base/java.util=ALL-UNNAMED to JAVA_OPTS allows the server to start.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 8.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content