JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleane

JDK11 Upgrade Fails - ClassNotFoundException jdk.internal.ref.Cleaner(JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleaner)

本文介绍了JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleaner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Java EE应用程序从JDK 8升级到JDK 11。但在部署到JBoss EAP 7.3服务器时,出现以下异常。

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

有解决方案吗?

推荐答案

您的代码应该使用java.lang.ref.Cleaner而不是jdk.internal.ref.Cleaner。后者在Java 9中被删除:

  • https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8149925

如果";Internal";Cleaner类的使用实际上来自第三方库代码,则需要将库升级到Java 11兼容版本。

这篇关于JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleaner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:JDK11升级失败-ClassNotFoundException jdk.inder.ref.Cleane