Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionInInitializerError caused by UnsatisfiedLinkError: Can't load library: /usr/lib/jna/libjnidispatch.so #34

Closed
GoogleCodeExporter opened this issue Apr 23, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Take the sample program from
http://code.google.com/p/gstreamer-java/wiki/VideoTestTutorial

2. Compile & run it


What is the expected output? What do you see instead?

- Expected: Video test image
- Get: 
--------8<--------
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.gstreamer.lowlevel.GNative.loadNativeLibrary(GNative.java:48)
    at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:45)
    at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)
    at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)
    at org.gstreamer.Gst.<clinit>(Gst.java:59)
    at test.gstreamer.GStreamerTest.main(GStreamerTest.java:25)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError:
Can't load library: /usr/lib/jna/libjnidispatch.so
    at com.sun.jna.Native.loadNativeLibrary(Native.java:644)
    at com.sun.jna.Native.<clinit>(Native.java:108)
    ... 6 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library:
/usr/lib/jna/libjnidispatch.so
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1657)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1003)
    at com.sun.jna.Native.loadNativeLibrary(Native.java:640)
    ... 7 more
--------8<--------


What version of the product are you using? On what operating system?

gstreamer-java Vers. 1.3

java -version says:
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)

OS is an up-to-date Debian Sid


Please provide any additional information below.

When using gstreamer-java Vers. 1.1, the program works as expected.

Original issue reported on code.google.com by tocr...@gmail.com on 5 Jan 2010 at 7:45

@GoogleCodeExporter
Copy link
Author

what's your jna version?
it seems you forget to install jna.
i check it and it works for me.

Original comment by lfar...@gmail.com on 26 Apr 2010 at 12:53

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Hi,

well, I guess I actually *do* have installed jna. Here's the structure of my
gstreamer subdirectory in my personal java lib folder:

~/lib/java/gstreamer/
├── 1.1
│   ├── gstreamer-java-bin-1.1.jar
│   ├── gstreamer-java.jar -> gstreamer-java-bin-1.1.jar
│   ├── jna-3.0.9.jar
│   └── jna.jar -> jna-3.0.9.jar
├── 1.3
│   ├── gstreamer-java-1.3.jar
│   ├── gstreamer-java.jar -> gstreamer-java-1.3.jar
│   ├── jna-3.2.4.jar
│   └── jna.jar -> jna-3.2.4.jar
└── current -> 1.1

In eclipse, I defined a "gstreamer" user library comprising both
"~/lib/java/gstreamer/current/gstreamer-java.jar" and
"~/lib/java/gstreamer/current/jna.jar". In included this user library into the 
sample
program's build path, and I do get a nice video test image with the "current" 
link
pointing to the 1.1 version's directory (as shown in the tree above). However, 
when
redirecting "current" to the 1.3 subdirectory, I get the exception described in 
my
original report.

Any ideas?

Regards --

Torsten

Original comment by tocr...@gmail.com on 1 May 2010 at 7:04

@GoogleCodeExporter
Copy link
Author

Update: In installed the Debian libjna-java package (which is at version 
3.2.4-1),
but still no success. What puzzles me is the "Can't load library:
/usr/lib/jna/libjnidispatch.so" lines in the error output. There is no such file
getting installed by libjna-java, only one "/usr/lib/jni/libjnidispatch.so" 
(see the
difference?). Anyway, where does this absolute path specification come from?

Wonders after wonders...

Original comment by tocr...@gmail.com on 1 May 2010 at 7:14

@GoogleCodeExporter
Copy link
Author

This looks to me like a Debian-specific issue with the libjna-java package.

Original comment by tsha...@gmail.com on 1 May 2010 at 7:49

@GoogleCodeExporter
Copy link
Author

After creating a link /usr/lib/jna -> /usr/lib/jni, the test program does run 
and
nicely display the test video, but it does throw loads of errors, too. First, 
it says

ERROR: Could not load classifier cascade
/usr/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml

and subsequently it continues throwing exceptions like

JNA: Callback org.gstreamer.Bus$15@b2fd8f threw the following exception:
java.lang.IllegalArgumentException: No known Enum mapping for
org.gstreamer.MessageType value=16777216
    at org.gstreamer.lowlevel.EnumMapper.valueOf(EnumMapper.java:74)
    at org.gstreamer.lowlevel.GTypeMapper$4.fromNative(GTypeMapper.java:147)
    at com.sun.jna.Structure.readField(Structure.java:494)
    at com.sun.jna.Structure.readField(Structure.java:413)
    at
org.gstreamer.lowlevel.SubtypeMapper$MessageMapper$MapHolder.subtypeFor(SubtypeM
apper.java:126)
    at org.gstreamer.lowlevel.SubtypeMapper$MessageMapper.subtypeFor(SubtypeMapper.java:132)
    at org.gstreamer.lowlevel.SubtypeMapper.subtypeFor(SubtypeMapper.java:70)
    at org.gstreamer.lowlevel.NativeObject.classFor(NativeObject.java:207)
    at org.gstreamer.lowlevel.NativeObject.objectFor(NativeObject.java:182)
    at org.gstreamer.lowlevel.GTypeMapper$3.fromNative(GTypeMapper.java:129)
    at
com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackRefere
nce.java:373)
    at
com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.ja
va:414)
JNA: Callback org.gstreamer.Bus$15@b2fd8f threw the following exception:
java.lang.IllegalArgumentException: No known Enum mapping for
org.gstreamer.MessageType value=16777216
    at org.gstreamer.lowlevel.EnumMapper.valueOf(EnumMapper.java:74)
    at org.gstreamer.lowlevel.GTypeMapper$4.fromNative(GTypeMapper.java:147)
    at com.sun.jna.Structure.readField(Structure.java:494)
    at com.sun.jna.Structure.readField(Structure.java:413)
    at
org.gstreamer.lowlevel.SubtypeMapper$MessageMapper$MapHolder.subtypeFor(SubtypeM
apper.java:126)
    at org.gstreamer.lowlevel.SubtypeMapper$MessageMapper.subtypeFor(SubtypeMapper.java:132)
    at org.gstreamer.lowlevel.SubtypeMapper.subtypeFor(SubtypeMapper.java:70)
    at org.gstreamer.lowlevel.NativeObject.classFor(NativeObject.java:207)
    at org.gstreamer.lowlevel.NativeObject.objectFor(NativeObject.java:182)
    at org.gstreamer.lowlevel.GTypeMapper$3.fromNative(GTypeMapper.java:129)
    at
com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackRefere
nce.java:373)
    at
com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.ja
va:414)

What I still don't understand: Why could I run 1.1 *withot* explicitly 
installing jna?

Regards --

Torsten

Original comment by tocr...@gmail.com on 1 Jun 2010 at 5:13

@GoogleCodeExporter
Copy link
Author

Could be gstreamer binaries version mismatch - try installing/compiling latest 
gstreamer

Original comment by tsha...@gmail.com on 15 Jun 2010 at 9:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant