shared object file - UnsatisfiedLinkError

K

K.Fawcett

I am getting a "java.lang.UnsatisfiedLinkError" while executing my
java program that points to a shared object file named "/home/mypath/
libServer_jni5323.so" and specifies a mangled name of an "undefined
symbol".

First, this file exists, but I did not create it. It
mysteriously (to me, anyway) appears only after executing my java
program. My java code uses a jar file provided to me by a customer
that contains libServer_jni.so. I am interested in the mechanics of
how this file appears and where the numbers (in this case "5323") come
from. Sometimes I see this file with different numbers -
libServer_jni####.so.

Second, if I use c++filt with the mangled symbol
name on libServer_jni5323.so it produces a result which I assume means
the symbol is defined in the .so file. If this is true, why the
"undefined symbol" error?
 
G

Gordon Beaton

I am getting a "java.lang.UnsatisfiedLinkError"

Use nm to see what symbols the file really contains. They shouldn't be
mangled, and if they are, the file probably can't be used with JNI as
is. Java has its own specific opinions about symbol naming.

Also, the shared library must exist in a "real" file system, it isn't
sufficient that it exists in a jarfile that belongs to the
application. My guess is that the java code copies the .so out from
the jarfile in order to load it, and that the number is used to make
the filename unique (it could be the process id).

Why don't you simply ask the customer who provided the file these
things? Or at least post the exact, complete error message you got
(hint: cut and paste, don't paraphrase).

/gordon

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top