尝试创建 ChronicleMap 时出现以下错误:
Exception in thread "main" net.openhft.chronicle.hash.ChronicleHashRecoveryFailedException: java.lang.UnsatisfiedLinkError: C:\Users\sando\AppData\Local\Temp\jna-109203563\jna13551597900255569913.dll: Can't find dependent libraries
at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1877)
at net.openhft.chronicle.map.ChronicleMapBuilder.createWithFile(ChronicleMapBuilder.java:1701)
at net.openhft.chronicle.map.ChronicleMapBuilder.recoverPersistedTo(ChronicleMapBuilder.java:1655)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1638)
at net.openhft.chronicle.map.ChronicleMapBuilder.createOrRecoverPersistedTo(ChronicleMapBuilder.java:1629)
at com.mycompany.app.App.createIndexOneFile(App.java:54)
at com.mycompany.app.App.createIndexOne(App.java:31)
at com.mycompany.app.App.main(App.java:23)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\sando\AppData\Local\Temp\jna-109203563\jna13551597900255569913.dll: Can't find dependent libraries
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
at java.base/java.lang.Runtime.load0(Runtime.java:765)
at java.base/java.lang.System.load(System.java:1834)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
at com.sun.jna.Native.<clinit>(Native.java:140)
at net.openhft.chronicle.hash.impl.util.jna.WindowsMsync.<clinit>(WindowsMsync.java:34)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.msync(VanillaChronicleHash.java:853)
at net.openhft.chronicle.hash.impl.VanillaChronicleHash.msync(VanillaChronicleHash.java:841)
at net.openhft.chronicle.map.ChronicleMapBuilder.commitChronicleMapReady(ChronicleMapBuilder.java:464)
at net.openhft.chronicle.map.ChronicleMapBuilder.openWithExistingFile(ChronicleMapBuilder.java:1871)
... 7 more
使用此代码:
String indexOnePath = "D:\\trabajo\\dbpedia\\dbpedia_files\\indexOne.bin";
File indexOneFile = new File(indexOnePath);
indexOne = ChronicleMap
.of(String.class, String.class)
.name("indexOne")
.entries(27191196)
.averageValue("<http://dbpedia.org/resource/Robert_Koch>")
.averageKey("Battle of Ardrianople")
.createOrRecoverPersistedTo(indexOneFile, true);
我的 pom.xml 依赖项如下所示:
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-map</artifactId>
<version>3.19.4</version>
</dependency>
我在 Windows 10 上使用 Java SDK 11.0.6。
似乎创建了文件,但随后出现异常。如果我使用 createOrRecoverPersistedTo 代替 create,似乎没有问题。