OpenHFT / Chronicle-Map

Replicate your Key Value Store across your network, with consistency, persistance and performance.
http://chronicle.software/products/chronicle-map/
Apache License 2.0
2.77k stars 469 forks source link

Chronicle-Map Oracle JDK 19 Support Issue #479

Closed SouthernYard closed 1 year ago

SouthernYard commented 1 year ago

Hi team,

Recently I update my JDK version to 19, but there is one issue when I try to create Chonicle-Map like the below:


net.openhft.chronicle.hash.ChronicleHashRecoveryFailedException: java.lang.AssertionError: java.lang.NoSuchMethodException: sun.nio.ch.FileChannelImpl.map0(int,long,long,boolean)

    at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1943)
    at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1711)
    at net.openhft.chronicle.map.ChronicleMapBuilder.recoverPersistedTo(ChronicleMapBuilder.java:1624)
    at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1607)
    at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1599)
    at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1593)
    at com.xronos.MainTest.test(MainTest.java:32)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
    at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
    at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
    at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.lang.AssertionError: java.lang.NoSuchMethodException: sun.nio.ch.FileChannelImpl.map0(int,long,long,boolean)
    at net.openhft.chronicle.core.Jvm.getMethod0(Jvm.java:629)
    at net.openhft.chronicle.core.Jvm.getMethod(Jvm.java:604)
    at net.openhft.chronicle.core.OS.lambda$static$0(OS.java:58)
    at net.openhft.chronicle.core.ClassLocal.computeValue(ClassLocal.java:54)
    at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:229)
    at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:211)
    at java.base/java.lang.ClassValue.get(ClassValue.java:117)
    at net.openhft.chronicle.core.OS.map0(OS.java:437)
    at net.openhft.chronicle.core.OS.map(OS.java:405)
    at net.openhft.chronicle.hash.impl.VanillaChronicleHash.map(VanillaChronicleHash.java:1096)
    at net.openhft.chronicle.hash.impl.VanillaChronicleHash.basicRecover(VanillaChronicleHash.java:537)
    at net.openhft.chronicle.map.VanillaChronicleMap.recover(VanillaChronicleMap.java:195)
    at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1924)
    ... 31 more
Caused by: java.lang.NoSuchMethodException: sun.nio.ch.FileChannelImpl.map0(int,long,long,boolean)
    at java.base/java.lang.Class.getDeclaredMethod(Class.java:2728)
    at net.openhft.chronicle.core.Jvm.getMethod0(Jvm.java:612)
    ... 43 more

Now the latest JDK version chronicle software support is JDK17.

  1. Is there any plan to support JDK 19?
  2. Is there any workaround approach to avoid this issue?
JerryShea commented 1 year ago

@SouthernYard supported Java versions are documented here, and we will support 21 as the next LTS version when it is released. Feel free to submit a patch if you would like it fixed sooner! (or contact us via https://chronicle.software/support/).

Having said that, I suspect that this may already have been fixed in the latest version.