Issue
I have upgraded my Java EE application to JDK 11 from JDK 8. But when I'm deploying into the JBOSS EAP 7.3 server I get the following exception.
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: jdk.internal.ref.Cleaner from [Module "deployment.DFNNTPOMS_X_X_3.003.000.00.0.ear" from Service Module Loader]
at deployment.DFNNTPOMS_X_X_3.003.000.00.0.ear//net.openhft.chronicle.hash.impl.util.CleanerUtils.<clinit>(CleanerUtils.java:42)
... 63 more
Caused by: java.lang.ClassNotFoundException: jdk.internal.ref.Cleaner from [Module "deployment.DFNNTPOMS_X_X_3.003.000.00.0.ear" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at deployment.DFNNTPOMS_X_X_3.003.000.00.0.ear//net.openhft.chronicle.hash.impl.util.CleanerUtils.<clinit>(CleanerUtils.java:35)
... 63 more
Any solution ?
Solution
Your code should use java.lang.ref.Cleaner
instead of jdk.internal.ref.Cleaner
. The latter was removed in Java 9:
If the usage of the "internal" Cleaner
class is actually coming from 3rd-party library code, then you need to upgrade the library to a Java 11 compatible version.
Answered By - Stephen C
Answer Checked By - Robin (JavaFixing Admin)