javachroniclechronicle-queuechronicle-bytes

chronicle with corretto jdk17 java.lang.NoSuchMethodError: 'sun.misc.Cleaner sun.nio.ch.DirectBuffer.cleaner()'


Trying to follow the guide on the chronicle blog. Have upgraded jars and added the following jvm options :

JDK17_VM_ARGS="-Dio.netty.tryReflectionSetAccessible=true
--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED 
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED 
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED 
--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED 
--add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED 
--add-opens=java.base/java.io=ALL-UNNAMED 
--add-opens=java.base/java.util=ALL-UNNAMED 
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED "  

DEFAULT_VM_ARGS="-XX:+UseParallelGC -Xms16g -Xmx16g -XX:NewRatio=3 -XX:MaxGCPauseMillis=500"

But still get the following exception

ERROR: Uncaught Exception: chronicle-source-1 java.lang.NoSuchMethodError: 'sun.misc.Cleaner sun.nio.ch.DirectBuffer.cleaner()' at net.openhft.lang.io.VanillaMappedBytes.cleanup(VanillaMappedBytes.java:95) ~[lang-6.8.2.jar:?] at net.openhft.lang.io.AbstractBytes.release(AbstractBytes.java:646) ~[lang-6.8.2.jar:?] at net.openhft.lang.io.VanillaMappedBytes.release(VanillaMappedBytes.java:86) ~[lang-6.8.2.jar:?] at net.openhft.lang.io.VanillaMappedBlocks.acquire0(VanillaMappedBlocks.java:63) ~[lang-6.8.2.jar:?] at net.openhft.lang.io.VanillaMappedBlocks.acquire(VanillaMappedBlocks.java:57) ~[lang-6.8.2.jar:?] at net.openhft.chronicle.IndexedChronicle$AbstractIndexedExcerpt.setDataBuffer(IndexedChronicle.java:515) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.IndexedChronicle$AbstractIndexedExcerpt.indexForRead(IndexedChronicle.java:440) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.IndexedChronicle$IndexedExcerptTailer.index(IndexedChronicle.java:964) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.tcp.SourceTcp$IndexedSessionHandler.write(SourceTcp.java:551) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.tcp.SourceTcp$SessionHandler.onWrite(SourceTcp.java:365) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.tcp.SourceTcp$SessionHandler.onSelectionKey(SourceTcp.java:327) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.tcp.SourceTcp$SessionHandler.vanillaNioLoop(SourceTcp.java:245) ~[chronicle-3.6.4.jar:?] at net.openhft.chronicle.tcp.SourceTcp$SessionHandler.run(SourceTcp.java:195) ~[chronicle-3.6.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) [?:?]

This is using amazon correto


Solution

  • Chronicle 3.6.4 was released in Jan 2017 and only supported on Java 7 and 8. (It was released before Java 11) If you need this version of Chronicle, I suggest only using Java 8.

    If you need a newer JVM, I suggest using Chronicle Queue 5.22 or later.