java.lang.ClassNotFoundException:sun.misc.Cleaner [英] java.lang.ClassNotFoundException: sun.misc.Cleaner
问题描述
使用Undertow 1.4.20(作为嵌入式Servlet引擎)时,在Java 9下运行我们的应用程序时出现此异常.=:java.lang.ClassNotFoundException: sun.misc.Cleaner
When using Undertow 1.4.20 (as embedded Servlet engine), i get this exception when running our app under Java 9.=: java.lang.ClassNotFoundException: sun.misc.Cleaner
原因是io.undertow.server.DirectByteBufferDeallocator
中的这一行:
tmpCleanerClean = Class.forName("sun.misc.Cleaner").getMethod("clean");
在Java 9中确实不再存在此类.但是可以使用替代方法:java.lang.ref.Cleaner
This class does indeed not exists anymore in Java 9. But a replacement is available: java.lang.ref.Cleaner
我现在可以忽略此异常吗?是否有解决此问题的时间表(即使Undertow Java 9兼容)?
Can i ignore this exception for now? Is there a timeline for fixing this (i.e. making undertow Java 9 compatible)?
推荐答案
这确实是一个错误,已在2.0.0.Alpha2和1.4.21.Final中解决.
This was indeed a bug, resolved in 2.0.0.Alpha2 and 1.4.21.Final.
请参见 https://issues.jboss.org/browse/UNDERTOW-1187
这篇关于java.lang.ClassNotFoundException:sun.misc.Cleaner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!