JBoss EAP 8.0 startup fails with `InaccessibleObjectException` and `NoClassDefFoundError` on JDK 21 when `PRESERVE_JAVA_OPTS=true` is set
Issue
- When starting JBoss EAP 8.0 on JDK 21 with the environment variable
PRESERVE_JAVA_OPTS=trueset, the process fails and theserver.logfile shows multiple errors. - The errors include
java.lang.reflect.InaccessibleObjectExceptionandjava.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-UNNAMEDtoJAVA_OPTSallows 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.