help needed

104 views
Skip to first unread message

Igor Berman

unread,
Aug 13, 2015, 12:22:09 PM8/13/15
to lmdbjni
I'm trying to use lmdb-jni with custom compiled lmdb(due to old version of centos & gcc) both are from https://github.com/deephacks
I'm adding liblmdb.so as -Djava.library.path=<path-where-it-exists>
and getting following error
java.lang.UnsatisfiedLinkError: org.fusesource.lmdbjni.JNI.init()V
at org.fusesource.lmdbjni.JNI.init(Native Method)
at org.fusesource.lmdbjni.JNI.<clinit>(JNI.java:42)
at org.fusesource.lmdbjni.Env.create(Env.java:42)
at org.fusesource.lmdbjni.Env.<init>(Env.java:36)

any suggestions will be highly appreciated



Kristoffer Sjögren

unread,
Aug 14, 2015, 10:01:06 AM8/14/15
to lmdbjni
Hi Igor

Could you open an issue on https://github.com/deephacks/lmdbjni?

Cheers,
-Kristoffer

Igor Berman

unread,
Sep 3, 2015, 12:14:51 PM9/3/15
to lmdbjni
Hi Kristoffer,
thanks for the response

I've resolved my problem ... sort of, here is the story:
We are creating fat jar with maven shade plugin, so lmdbjni libraries are assembled withing fat jar(also so & META-INFO - checked it)
So when lmdbjni jar is part of fat jar I'm getting such exception which is very strange - I mean it doesn't complains that library isn't there, it complains that function isn't there...I'm not pro in JNI, so maybe I'm totally wrong here
I made few tests and in lsof I seen both lmdb.so and lmdjni libraries opened by java process

bottom line, when I'm adding lmdbjni jars to classpath as separate jars and not part of fat jar everything works

Kristoffer Sjögren

unread,
Sep 3, 2015, 2:46:00 PM9/3/15
to lmdbjni
Hi

A fat jar should in theory not be a problem. 

If you can send me the fat jar (with lmdbjni in it as you intend to package it) I can have a look and see if I can find the problem.

Cheers,
-Kristoffer

Kristoffer Sjögren

unread,
Sep 3, 2015, 2:53:08 PM9/3/15
to lmdbjni
You could also try debug-step through org.fusesource.hawtjni.runtime.Library.doLoad() and see how mechanism for loading the library works.
Reply all
Reply to author
Forward
0 new messages