fusesource / leveldbjni

A Java Native Interface to LevelDB
BSD 3-Clause "New" or "Revised" License
535 stars 145 forks source link

java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no leveldbjni64-1.8 in java.library.path #80

Open icehong opened 7 years ago

icehong commented 7 years ago

I am running opendaylight beryllium verison on windows 7 x64, I and got such error when startup karaf framework. I think leveldbjni crash because of lack of some system dlls, see the logs and screen capture.

E:\odl\distribution-karaf-0.4.3-Beryllium-SR3\bin>karaf Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; sup port was removed in 8.0

________                       ________                .__  .__       .__

_ \ ____ __ \ _ _..| | |**| ** | | / | / | __ _/ \ / \ | | _ < | || | | |/ **| | \ \ / | \ |> > /| | | ` \/ _ || || / // > Y \ | ___ / / >| /_** ( / ||/_ /|_| /_| \/|**| \/ \/ \/ \/\/ /**/ \ /

Hit '' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root> opendaylight-user@root> opendaylight-user@root> opendaylight-user@root> opendaylight-user@root>Uncaught error from thread [opendaylight-cluster-data-akk a.persistence.dispatchers.default-plugin-dispatcher-22] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[opendaylight-cluster-d ata] java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no leveldbjni6 4-1.8 in java.library.path, no leveldbjni-1.8 in java.library.path, E:\odl\distr ibution-karaf-0.4.3-Beryllium-SR3\data\cache\org.eclipse.osgi\bundles\178\1.cp\ META-INF\native\windows64\leveldbjni.dll: Can't find dependent libraries, E:\odl \distribution-karaf-0.4.3-Beryllium-SR3\data\tmp\leveldbjni-64-1-534075808401160 7636.8: Can't find dependent libraries] at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:187) at org.fusesource.hawtjni.runtime.Library.load(Library.java:143) at org.fusesource.leveldbjni.JniDBFactory.(JniDBFactory.java:48)

    at akka.persistence.journal.leveldb.LeveldbStore$class.leveldbFactory(Le

veldbStore.scala:36) at akka.persistence.journal.leveldb.LeveldbJournal.leveldbFactory(Leveld bJournal.scala:20) at akka.persistence.journal.leveldb.LeveldbStore$class.preStart(LeveldbS tore.scala:112) at akka.persistence.journal.leveldb.LeveldbJournal.preStart(LeveldbJourn al.scala:20) at akka.actor.Actor$class.aroundPreStart(Actor.scala:472) at akka.persistence.journal.leveldb.LeveldbJournal.aroundPreStart(Leveld bJournal.scala:20) at akka.actor.ActorCell.create(ActorCell.scala:580) at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456) at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478) at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263) at akka.dispatch.Mailbox.run(Mailbox.scala:219) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:617) at java.lang.Thread.run(Thread.java:745) E:\odl\distribution-karaf-0.4.3-Beryllium-SR3\bin>

debug

rishibamba commented 7 years ago

Hi any fix for the same ?

Thanks.

ghost commented 7 years ago

I ran into the same issue, after some investigation I (well mostly @vdmdmv) found that the problem was that the native source is dynamically linked against the Visual Studio 2010 runtime. It seems like a decent solution to this problem would be to package whatever runtime is being used like the native leveldb code gets packaged. The workaround @vdmdmv and I found was to just download and install the VS2010 redistributable package, after that everything worked fantastically

ketank-new commented 6 years ago

How to resolve this on Linux

gvishal commented 6 years ago

@following

ghost commented 6 years ago

have you tried unzipping the jar and using ldd to figure out what runtime the jni library is linked against?

gvishal commented 6 years ago

I instead used RocksDb which has the same API and was working fine. See here:

https://github.com/dalab/pboh-entity-linking/issues/4#issuecomment-318285695

ValleZ commented 6 years ago

I hit the same problem and the answer was that I included wrong library from maven. Instead org.fusesource.leveldbjni:leveldbjni-all:1.8 it was org.fusesource.leveldbjni:leveldbjni:1.8. The latter doesn't contain any native libraries.

anuscool commented 6 years ago

T E S T S

Running org.fusesource.rocksdbjni.test.DBTest Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.286 sec <<< FAILURE! - in org.fusesource.rocksdbjni.test.DBTest warning(junit.framework.TestSuite$1) Time elapsed: 0.022 sec <<< FAILURE! junit.framework.AssertionFailedError: Exception in constructor: testOpen (java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no rocksdbjni64-99-master-SNAPSHOT in java.library.path, no rocksdbjni-99-master-SNAPSHOT in java.library.path, /home/anupam/Arm_project/rocksdbjni/rocksdbjni-linux64/target/generated-sources/hawtjni/lib/META-INF/native/linux64/librocksdbjni.so: /home/anupam/Arm_project/rocksdbjni/rocksdbjni-linux64/target/generated-sources/hawtjni/lib/META-INF/native/linux64/librocksdbjni.so: undefined symbol: _ZTIN7rocksdb6LoggerE, /tmp/librocksdbjni-64-99-master-SNAPSHOT-162918278252525277.so: /tmp/librocksdbjni-64-99-master-SNAPSHOT-162918278252525277.so: undefined symbol: _ZTIN7rocksdb6LoggerE] at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:187) at org.fusesource.hawtjni.runtime.Library.load(Library.java:143) at org.fusesource.rocksdbjni.JniDBFactory.(JniDBFactory.java:47) at org.fusesource.rocksdbjni.test.DBTest.(DBTest.java:55) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

i am getting this error how to solve it

shameem16 commented 3 years ago

I hit the same problem and the answer was that I included wrong library from maven. Instead org.fusesource.leveldbjni:leveldbjni-all:1.8 it was org.fusesource.leveldbjni:leveldbjni:1.8. The latter doesn't contain any native libraries.

should we give this

org.fusesource.leveldbjni leveldbjni-all 1.8

in settings.xml of maven folder

ghost commented 3 years ago

For me, installing the Microsoft Visual C++ 2010 redistributable package resolved this issue