JavaMelody error - java.lang.NoSuchMethodError: sun.nio.ch.DirectBuffer.cleaner()Lsun/misc/Cleaner

199 views Asked by At

Im working on an application that runs with Wildfly 11 as its application server on JDK 11 and uses java melody 1.55.0 as its monitoring tool. The thing is, when i open the java melody, the graphs could not be loaded and i saw this error in the log:

typeERROR [io.undertow.request] (default task-9) UT005023: Exception handling request to /com.adins.mss.webapp/monitoring: java.lang.NoSuchMethodError: sun.nio.ch.DirectBuffer.cleaner()Lsun/misc/Cleaner;
    at deployment.com.adins.mss.webapp-1.0.0-SNAPSHOT.war//net.bull.javamelody.RrdNioBackend.unmapFile(RrdNioBackend.java:102)
    at deployment.com.adins.mss.webapp-1.0.0-SNAPSHOT.war//net.bull.javamelody.RrdNioBackend.close(RrdNioBackend.java:167)
    at deployment.com.adins.mss.webapp-1.0.0-SNAPSHOT.war//org.jrobin.core.RrdDb.close(RrdDb.java:443)
    at deployment.com.adins.mss.webapp-1.0.0-SNAPSHOT.war//org.jrobin.core.RrdDbPool.release(RrdDbPool.java:196) here

Does anyone know what it means and how to solve this ?

tried adding this argument to the JVM '--add-opens java.base/java.lang=ALL-UNNAMED ' but nothings changed.

2

There are 2 answers

1
Mr_Thorynque On

Maybe with this 2 JVM options

"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
0
evernat On

You are using javamelody version 1.55.0. This compatibility issue with Java 9+ was fixed in javamelody version 1.65.0.

Please upgrade javamelody. Latest javamelody version is 1.92.0 at the moment.