java -jamvm : error java.lang.UnsatisfiedLinkError

Asked by R A on 2018-12-05

Running a Java application using jamvm which links a third party library is not able to link.

Java version used..

root@FX:/apps# java -jamvm -version
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-8u102-b14.1-2-b14)
JamVM (build 2.0.0, inline-threaded interpreter with stack-caching)
root@FX:/apps#

I have set LD_LIBRARY_PATH correctly.
root@FX:~# echo $LD_LIBRARY_PATH
/platform/lib/
root@FX:~#

root@FX:~# java -jamvm -jar /apps/RFIDSampleApp1.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: RFID_Connect
 at com.mot.rfid.api3.API3Natives.RFID_Connect(Native Method)
 at com.mot.rfid.api3.API3Natives.Connect(API3Natives.java:595)
 at com.mot.rfid.api3.RFIDReader.connect(RFIDReader.java:375)
 at org.zebra.RFIDSample4App.RFIDSample4App.connectToReader(RFIDSample4App.java:1517)
 at org.zebra.RFIDSample4App.RFIDSample4App.<init>(RFIDSample4App.java:167)
 at org.zebra.RFIDSample4App.RFIDSample4App.main(RFIDSample4App.java:1562)
 ... 5 more
root@FX:~#

While I am able to run a sample hello application...
root@FX:~# java -jamvm -jar /apps/hello.jar
Hello, World

Below is the verbose:jni log of linker error.

Dynamic-linking native method java.net.NetworkInterface.getMacAddr0 ... JNI]
[Dynamic-linking native method sun.misc.Unsafe.copyMemory ... internal]
[Dynamic-linking native method sun.misc.Unsafe.putByte ... internal]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.opendir0 ... JNI]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.readdir ... JNI]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.closedir ... JNI]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.open0 ... JNI]
[Dynamic-linking native method sun.nio.ch.IOUtil.initIDs ... JNI]
[Dynamic-linking native method sun.nio.ch.IOUtil.iovMax ... JNI]
[Dynamic-linking native method sun.nio.ch.FileChannelImpl.initIDs ... JNI]
[Dynamic-linking native method sun.nio.ch.FileDispatcherImpl.init ... JNI]
[Dynamic-linking native method sun.nio.ch.FileDispatcherImpl.close0 ... JNI]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.lstat0 ... JNI]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.unlink0 ... JNI]
[Dynamic-linking native method sun.nio.ch.NativeThread.init ... JNI]
[Dynamic-linking native method sun.nio.ch.NativeThread.current ... JNI]
[Dynamic-linking native method sun.misc.Unsafe.pageSize ... internal]
[Dynamic-linking native method sun.misc.Unsafe.getLongVolatile ... internal]
[Dynamic-linking native method sun.misc.Unsafe.setMemory ... internal]
[Dynamic-linking native method sun.nio.ch.FileDispatcherImpl.write0 ... JNI]
[Dynamic-linking native method com.mot.rfid.api3.API3Natives.RFID_Connect ... ]
[Dynamic-linking native method java.io.FileOutputStream.writeBytes ... JNI]
Exception in thread "main" [Dynamic-linking native method java.lang.System.identityHashCode ... JNI]
java.lang.reflect.InvocationTargetException
[Dynamic-linking native method java.lang.Throwable.getStackTraceDepth ... JNI]
[Dynamic-linking native method java.lang.Throwable.getStackTraceElement ... JNI]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: RFID_Connect
 at com.mot.rfid.api3.API3Natives.RFID_Connect(Native Method)
 at com.mot.rfid.api3.API3Natives.Connect(API3Natives.java:595)
 at com.mot.rfid.api3.RFIDReader.connect(RFIDReader.java:375)
 at org.zebra.RFIDSample4App.RFIDSample4App.connectToReader(RFIDSample4App.java:1517)
 at org.zebra.RFIDSample4App.RFIDSample4App.<init>(RFIDSample4App.java:167)
 at org.zebra.RFIDSample4App.RFIDSample4App.main(RFIDSample4App.java:1562)
 ... 5 more
[Dynamic-linking native method java.io.UnixFileSystem.delete0 ... JNI]
root@FX:/apps#

I do not get the UnsatisfiedLinkError error with java "OpenJDK Zero VM (build 25.102-b14, interpreted mode) "

root@FX:/apps# java -jar /apps/RFIDSampleApp1.jar
Connected to 127.0.0.1
..................................................
Welcome to RFID API3 Java Standard Sample Application
..................................................

Question information

Language:
English Edit question
Status:
Needs information
For:
Ubuntu openjdk-8 Edit question
Assignee:
No assignee Edit question
Last query:
2018-12-05
Last reply:
2018-12-07

I suggest you post on a Java forum too, this is closer to your issue

Can you help with this problem?

Provide an answer of your own, or ask R A for more information if necessary.

To post a message you must log in.