orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.75k stars 871 forks source link

UnsatisfiedLinkError: Could not locate stub library in jar file #9631

Open dimitrievgs opened 3 years ago

dimitrievgs commented 3 years ago

OrientDB Version: 3.1.10 - 3.2.0

Java Version: OpenJDK 11

OS: Windows 10

Expected behavior

Trying to load latest java binding using

    <properties>
        <orientdb.version>3.2.0</orientdb.version> <!-- 3.0.37, 3.2.0 -->
    </properties>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/com.orientechnologies/orientdb-core -->
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-core</artifactId>
            <version>${orientdb.version}</version>
        </dependency>
    </dependencies>

But get

error text Jun 28, 2021 6:07:11 PM com.orientechnologies.common.log.OLogManager log INFO: Windows OS is detected, 262144 limit of open files will be set for the disk cache. Warning: Nashorn engine is planned to be removed from a future JDK release Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: 8523661312 B/8128 MB/7 GB of physical memory were detected on machine Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: Detected memory limit for current process is 8523661312 B/8128 MB/7 GB Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: JVM can use maximum 2034MB of heap memory Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: Because OrientDB is running outside a container 2g of memory will be left unallocated according to the setting 'memory.leftToOS' not taking into account heap memory Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: OrientDB auto-config DISKCACHE=4,046MB (heap=2,034MB os=8,128MB) Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: System is started under an effective user : `G` Jun 28, 2021 6:07:12 PM com.orientechnologies.common.log.OLogManager log INFO: Allocation of 61499 pages. Exception in Application start method java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051) Caused by: java.lang.RuntimeException: Exception in Application start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: could not locate stub library in jar file. Tried [jni/x86_64-Windows/jffi-1.2.dll, /jni/x86_64-Windows/jffi-1.2.dll] at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:416) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:359) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.load(StubLoader.java:262) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.(StubLoader.java:453) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at jffi@1.2.19/com.kenai.jffi.Init.load(Init.java:68) at jffi@1.2.19/com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at jffi@1.2.19/com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at jffi@1.2.19/com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at jffi@1.2.19/com.kenai.jffi.Platform$ArchHolder.determineCPU(Platform.java:208) at jffi@1.2.19/com.kenai.jffi.Platform$ArchHolder.(Platform.java:195) at jffi@1.2.19/com.kenai.jffi.Platform.getCPU(Platform.java:299) at jffi@1.2.19/com.kenai.jffi.Platform.addressMask(Platform.java:333) at jffi@1.2.19/com.kenai.jffi.MemoryIO.(MemoryIO.java:47) at orientdb.core@3.1.10/com.orientechnologies.common.directmemory.ODirectMemoryAllocator.allocate(ODirectMemoryAllocator.java:148) at orientdb.core@3.1.10/com.orientechnologies.common.directmemory.OByteBufferPool.acquireDirect(OByteBufferPool.java:142) at orientdb.core@3.1.10/com.orientechnologies.orient.core.engine.local.OEngineLocalPaginated.startup(OEngineLocalPaginated.java:106) at orientdb.core@3.1.10/com.orientechnologies.orient.core.Orient.onEmbeddedFactoryInit(Orient.java:976) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDBEmbedded.(OrientDBEmbedded.java:107) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDBInternal.embedded(OrientDBInternal.java:110) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDB.(OrientDB.java:185) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDB.(OrientDB.java:134) at org.vanilla_manager/org.vanilla_manager.orientdb.OrientdbTalker.init(OrientdbTalker.java:70) at org.vanilla_manager/org.vanilla_manager.orientdb.OrientdbJavafx.(OrientdbJavafx.java:34) at org.vanilla_manager/org.vanilla_manager.App.start(App.java:42) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:829) at jffi@1.2.19/com.kenai.jffi.Foreign.newLoadError(Foreign.java:72) at jffi@1.2.19/com.kenai.jffi.Foreign.access$300(Foreign.java:42) at jffi@1.2.19/com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:98) at jffi@1.2.19/com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at jffi@1.2.19/com.kenai.jffi.MemoryIO.(MemoryIO.java:44) at jffi@1.2.19/com.kenai.jffi.MemoryIO.(MemoryIO.java:41) at jffi@1.2.19/com.kenai.jffi.MemoryIO$NativeImpl.(MemoryIO.java:593) at jffi@1.2.19/com.kenai.jffi.MemoryIO$NativeImpl.(MemoryIO.java:593) at jffi@1.2.19/com.kenai.jffi.MemoryIO$NativeImpl64.(MemoryIO.java:834) at jffi@1.2.19/com.kenai.jffi.MemoryIO$NativeImpl64.(MemoryIO.java:834) at jffi@1.2.19/com.kenai.jffi.MemoryIO.newNativeImpl64(MemoryIO.java:120) at jffi@1.2.19/com.kenai.jffi.MemoryIO.newNativeImpl(MemoryIO.java:101) at jffi@1.2.19/com.kenai.jffi.MemoryIO.newMemoryIO(MemoryIO.java:89) at jffi@1.2.19/com.kenai.jffi.MemoryIO.access$000(MemoryIO.java:41) at jffi@1.2.19/com.kenai.jffi.MemoryIO$SingletonHolder.(MemoryIO.java:51) at jffi@1.2.19/com.kenai.jffi.MemoryIO.getInstance(MemoryIO.java:64) at orientdb.core@3.1.10/com.orientechnologies.common.directmemory.ODirectMemoryAllocator.allocate(ODirectMemoryAllocator.java:148) at orientdb.core@3.1.10/com.orientechnologies.common.directmemory.OByteBufferPool.acquireDirect(OByteBufferPool.java:142) at orientdb.core@3.1.10/com.orientechnologies.orient.core.engine.local.OEngineLocalPaginated.startup(OEngineLocalPaginated.java:106) at orientdb.core@3.1.10/com.orientechnologies.orient.core.Orient.onEmbeddedFactoryInit(Orient.java:976) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDBEmbedded.(OrientDBEmbedded.java:107) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDBInternal.embedded(OrientDBInternal.java:110) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDB.(OrientDB.java:185) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDB.(OrientDB.java:134) at org.vanilla_manager/org.vanilla_manager.orientdb.OrientdbTalker.init(OrientdbTalker.java:70) at org.vanilla_manager/org.vanilla_manager.orientdb.OrientdbJavafx.(OrientdbJavafx.java:34) at org.vanilla_manager/org.vanilla_manager.App.start(App.java:42) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) ... 1 more Caused by: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: could not locate stub library in jar file. Tried [jni/x86_64-Windows/jffi-1.2.dll, /jni/x86_64-Windows/jffi-1.2.dll] at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:416) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:359) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.load(StubLoader.java:262) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.(StubLoader.java:453) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at jffi@1.2.19/com.kenai.jffi.Init.load(Init.java:68) at jffi@1.2.19/com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at jffi@1.2.19/com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at jffi@1.2.19/com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at jffi@1.2.19/com.kenai.jffi.Platform$ArchHolder.determineCPU(Platform.java:208) at jffi@1.2.19/com.kenai.jffi.Platform$ArchHolder.(Platform.java:195) at jffi@1.2.19/com.kenai.jffi.Platform.getCPU(Platform.java:299) at jffi@1.2.19/com.kenai.jffi.Platform.addressMask(Platform.java:333) at jffi@1.2.19/com.kenai.jffi.MemoryIO.(MemoryIO.java:47) at orientdb.core@3.1.10/com.orientechnologies.common.directmemory.ODirectMemoryAllocator.allocate(ODirectMemoryAllocator.java:148) at orientdb.core@3.1.10/com.orientechnologies.common.directmemory.OByteBufferPool.acquireDirect(OByteBufferPool.java:142) at orientdb.core@3.1.10/com.orientechnologies.orient.core.engine.local.OEngineLocalPaginated.startup(OEngineLocalPaginated.java:106) at orientdb.core@3.1.10/com.orientechnologies.orient.core.Orient.onEmbeddedFactoryInit(Orient.java:976) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDBEmbedded.(OrientDBEmbedded.java:107) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDBInternal.embedded(OrientDBInternal.java:110) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDB.(OrientDB.java:185) at orientdb.core@3.1.10/com.orientechnologies.orient.core.db.OrientDB.(OrientDB.java:134) at org.vanilla_manager/org.vanilla_manager.orientdb.OrientdbTalker.init(OrientdbTalker.java:70) at org.vanilla_manager/org.vanilla_manager.orientdb.OrientdbJavafx.(OrientdbJavafx.java:34) at org.vanilla_manager/org.vanilla_manager.App.start(App.java:42) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:829) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.load(StubLoader.java:274) at jffi@1.2.19/com.kenai.jffi.internal.StubLoader.(StubLoader.java:453) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at jffi@1.2.19/com.kenai.jffi.Init.load(Init.java:68) at jffi@1.2.19/com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at jffi@1.2.19/com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at jffi@1.2.19/com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at jffi@1.2.19/com.kenai.jffi.Platform$ArchHolder.determineCPU(Platform.java:208) at jffi@1.2.19/com.kenai.jffi.Platform$ArchHolder.(Platform.java:195) at jffi@1.2.19/com.kenai.jffi.Platform.getCPU(Platform.java:299) at jffi@1.2.19/com.kenai.jffi.Platform.addressMask(Platform.java:333) at jffi@1.2.19/com.kenai.jffi.MemoryIO.(MemoryIO.java:47) ... 21 more Exception running application org.vanilla_manager.App Disconnected from the target VM, address: '127.0.0.1:50348', transport: 'socket' Process finished with exit code 1

Actual behavior

App doesn't start. It works (starts) with 3.0.37 version, but I want to check out if problem with updating properties only after restarting app persists in later versions (I will open another issue).

Steps to reproduce

Adds info to pom ^. Try to compile with code like:

    String orientdb_path = "embedded:D:/orient_dbs/"; //"embedded:/tmp/"
    String db_name = "some_db";
    String user_name = "admin";
    String password = "admin";

    public OrientdbTalker() {
    }

    private OrientDB orientDB;

    //-------------------------------------------------------------------------
    //--------------------------Init & Preparation-----------------------------

    public void init() {
        try {
            orientDB = new OrientDB(orientdb_path, OrientDBConfig.defaultConfig()); //it fires error

            boolean db_exists = orientDB.exists(db_name);

            if (db_exists == false) {
                orientDB.create(db_name, ODatabaseType.PLOCAL);
            }

            createBaseOClasses();
            findRootOVertex();
        } catch (Exception e) {
            MessageBox.Show(e);
        }
    } 

<An SQL script to reproduce the problem or a JUnit test case will increase A LOT the chance to have a quick fix>

dimitrievgs commented 3 years ago

Ok, this one was solved with:

    <properties>
        <orientdb.version>3.1.11</orientdb.version> <!-- 3.0.37 -->
        <jnr-ffi.version>2.2.4</jnr-ffi.version> <!-- Needed for orientdb since 3.1.X -->
    </properties>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/com.orientechnologies/orientdb-core -->
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-core</artifactId>
            <version>${orientdb.version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.github.jnr/jnr-ffi -->
        <dependency>
            <groupId>com.github.jnr</groupId>
            <artifactId>jnr-ffi</artifactId>
            <version>${jnr-ffi.version}</version>
        </dependency>
    </dependencies>