[Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
Polymar
Posts: 6
Joined: 16 Oct 2020, 22:27

[Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by Polymar »

LHello,
After upgrading to Buster release, I realized that filebot was moving no more my TV shows in the correct folder.

I ran the sysinfo script that showed a problem with JNA Native but even after reinstalling it the problem was not solved.
This is the output
https://pastebin.com/Pjda2SuY


Can someone point me in the right direction please?
Thanks in advance,
Renato
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rpi Buster - JNA Native Error

Post by rednoah »

You're missing the JNA native libraries. The JNA native libraries are typically installed by apt automatically when filebot is installed.

:?: Is JNA installed? If yes, where is jnidispatch?

Code: Select all

find /usr/lib '*jnidispatch*'
:?: How did you install FileBot?

:?: What does the console say if you run the the installer commands?

:arrow: https://www.filebot.net/linux/apt.html
:idea: Please read the FAQ and How to Request Help.
Polymar
Posts: 6
Joined: 16 Oct 2020, 22:27

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by Polymar »

Hello,
thanks for the reply.

Code: Select all

find /usr/lib '*jnidispatch*'
is not found on my rpi.
I installed it using the deb.sh you mentioned in your reply: trying to run it again gave me THIS I can't see any error.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by rednoah »

libjnidispatch should be at this location according to the package file listing:

Code: Select all

/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.system.so
:arrow: https://packages.debian.org/buster/armh ... i/filelist


:!: If it's not there, then FileBot will not find it.


:arrow: I'd start by getting a file listing for the libjna-jni package that your distribution uses to see where they put the *.so file. You might have to ask in the Raspberry Pi forums on how to contact the package maintainers on issues where the Raspberry Pi package is different from the Debian package.
:idea: Please read the FAQ and How to Request Help.
Polymar
Posts: 6
Joined: 16 Oct 2020, 22:27

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by Polymar »

Hello, before posting anywhere else I took a look to the file system:
Image

The file IS there but even if I run the find as root nothing pops up.
Could it be a permission problem at this point?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by rednoah »

What does filebot -script fn:sysenv say?

Code: Select all

filebot -script fn:sysenv

Does file listing work?

Code: Select all

find /usr/lib/arm-linux-gnueabihf/jni

:idea: /usr/lib are system files. They're always owned by root. That's why you need root to use apt to install packages. rw-r--r-- means these files can be read by all users so that should be fine.
:idea: Please read the FAQ and How to Request Help.
Polymar
Posts: 6
Joined: 16 Oct 2020, 22:27

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by Polymar »

THIS is the output of the script.

This is the command:

Code: Select all

pi@raspberrypi:~ $ find /usr/lib/arm-linux-gnueabihf/jni
/usr/lib/arm-linux-gnueabihf/jni
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so.6.0.0
/usr/lib/arm-linux-gnueabihf/jni/libjfxmedia.so
/usr/lib/arm-linux-gnueabihf/jni/libglassgtk3.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_common.so
/usr/lib/arm-linux-gnueabihf/jni/libavplugin.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so.6
/usr/lib/arm-linux-gnueabihf/jni/libsnappyjava.so
/usr/lib/arm-linux-gnueabihf/jni/libfxplugins.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so
/usr/lib/arm-linux-gnueabihf/jni/libjfxwebkit.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font_pango.so
/usr/lib/arm-linux-gnueabihf/jni/libdecora_sse.so
/usr/lib/arm-linux-gnueabihf/jni/libglassgtk2.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_es2.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_sw.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_iio.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.system.so
/usr/lib/arm-linux-gnueabihf/jni/libglass.so
/usr/lib/arm-linux-gnueabihf/jni/libgstreamer-lite.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font_freetype.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font.so
Thanks in advance,
R
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by rednoah »

Sorry. I'm out of ideas. Looks like everything is configured correctly. And the library is there. So it should work. Makes no sense to me.

Code: Select all

jna.boot.library.name: jnidispatch.system
jna.boot.library.path: /usr/lib/arm-linux-gnueabihf/jni


You could try googling for generic JNA debug advice. There's a few options you could try that might give you some insights on what JNA is trying to do step by step:

Code: Select all

export JAVA_OPTS="-Djna.debug_load=true -Djna.debug_load.jna=true"
filebot -script fn:sysinfo

:!: find not being able to find a file that we know is there is also a hint, and very strange. You could try a few things with find to see what works and what doesn't. Perhaps find and JNA can't find the jnidispatch library for the same reason.




EDIT:

I also found some Debian-specific patches that seem to hardcode/replace the search path with arm-linux-gnueabi and thus actively break things on machines with less popular architectures:
* https://sources.debian.org/patches/libj ... -fs.patch/
* https://sources.debian.org/patches/libj ... ary.patch/



EDIT 2:

That patch also seems to hardcode /usr/lib/jni as search path. Check if a copy of libjnidispatch.system.so is there as well, and if not, copy it there.
:idea: Please read the FAQ and How to Request Help.
Polymar
Posts: 6
Joined: 16 Oct 2020, 22:27

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by Polymar »

I'll give it a try and get back with the results. Thanks again for the suggestions
R
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by rednoah »

Try setting jna.nosys=false and see if that makes things work:

Code: Select all

filebot -script fn:properties --def jna.nosys=false
filebot -script fn:sysinfo
:idea: Please read the FAQ and How to Request Help.
Polymar
Posts: 6
Joined: 16 Oct 2020, 22:27

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by Polymar »

The problem seems to be solved! what did the new script do?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by rednoah »

Setting -Djna.nosys=false will force JNA to load the library via System.loadLibrary() which in turns respects our -Djava.library.path=/usr/lib/arm-linux-gnueabihf/jni property.
:idea: Please read the FAQ and How to Request Help.
chapototo
Posts: 4
Joined: 21 Oct 2020, 18:36

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by chapototo »

hello,
i have been using filebot for years without problem but after upgrading to buster, my tvshows won't move in the correct folder.

Code: Select all

filebot -script fn:sysinfo
returns:

Code: Select all

FileBot 4.9.2 (r8046)
JNA Native: java.lang.UnsatisfiedLinkError: Can't obtain static method fromNative(Method, Object) from class com.sun.jna.Native
MediaInfo: net.filebot.mediainfo.MediaInfoException: Unable to load arm (32-bit) native library libmediainfo.so: Could not initialize class com.sun.jna.Native
I can't find libjnidispatch.so via

Code: Select all

find /usr/lib '*jnidispatch*'
but it seems at the right place

Code: Select all

find /usr/lib/arm-linux-gnueabihf/jni
/usr/lib/arm-linux-gnueabihf/jni
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_3.2.7.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_es2.so
/usr/lib/arm-linux-gnueabihf/jni/libfxplugins.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_iio.so
/usr/lib/arm-linux-gnueabihf/jni/libglass.so
/usr/lib/arm-linux-gnueabihf/jni/libglassgtk3.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so.6
/usr/lib/arm-linux-gnueabihf/jni/libdecora_sse.so
/usr/lib/arm-linux-gnueabihf/jni/libjfxmedia.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_4.2.2.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_common.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.system.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font_freetype.so
/usr/lib/arm-linux-gnueabihf/jni/libavplugin.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font_pango.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_sw.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so.6.0.0
/usr/lib/arm-linux-gnueabihf/jni/libjfxwebkit.so
/usr/lib/arm-linux-gnueabihf/jni/libglassgtk2.so
/usr/lib/arm-linux-gnueabihf/jni/libgstreamer-lite.so
and setting

Code: Select all

filebot -script fn:properties --def jna.nosys=false
changes nothing...
i have the same sysenv as Polymar :?

i tried the portable version of filebot and the java error disappeared but my tvshows weren't moving in the correct folder either.
if something else pop on your mind :D
Thanks a lot
chapototo
Posts: 4
Joined: 21 Oct 2020, 18:36

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by chapototo »

allright,
after renaming a subfolder from the download path from "films" to "temp" , my tvshows move at the right place. But using Filebot-portable. With the apt install, i'm still having the error

Code: Select all

FileBot 4.9.2 (r8046)
JNA Native: java.lang.UnsatisfiedLinkError: Can't obtain static method fromNative(Method, Object) from class com.sun.jna.Native
MediaInfo: net.filebot.mediainfo.MediaInfoException: Unable to load arm (32-bit) native library libmediainfo.so: Could not initialize class com.sun.jna.Native
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by rednoah »

Well, apt shouldn't allow you to have different versions of the same package installed, yet here's libjnidispatch in triplicate, so dependency hell?

Code: Select all

/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_3.2.7.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_4.2.2.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.system.so
:idea: Please read the FAQ and How to Request Help.
chapototo
Posts: 4
Joined: 21 Oct 2020, 18:36

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by chapototo »

Code: Select all

find /usr/lib/arm-linux-gnueabihf/jni
/usr/lib/arm-linux-gnueabihf/jni
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_es2.so
/usr/lib/arm-linux-gnueabihf/jni/libfxplugins.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_iio.so
/usr/lib/arm-linux-gnueabihf/jni/libglass.so
/usr/lib/arm-linux-gnueabihf/jni/libglassgtk3.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so.6
/usr/lib/arm-linux-gnueabihf/jni/libdecora_sse.so
/usr/lib/arm-linux-gnueabihf/jni/libjfxmedia.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_4.2.2.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_common.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.system.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font_freetype.so
/usr/lib/arm-linux-gnueabihf/jni/libavplugin.so
/usr/lib/arm-linux-gnueabihf/jni/libjavafx_font_pango.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.so
/usr/lib/arm-linux-gnueabihf/jni/libprism_sw.so
/usr/lib/arm-linux-gnueabihf/jni/libatk-wrapper.so.6.0.0
/usr/lib/arm-linux-gnueabihf/jni/libjfxwebkit.so
/usr/lib/arm-linux-gnueabihf/jni/libglassgtk2.so
/usr/lib/arm-linux-gnueabihf/jni/libgstreamer-lite.so
/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_3.2.7.so
was just an old symlink.

Code: Select all

ls -l "/usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.so"
lrwxrwxrwx 1 root root 23 Oct 14 16:18 /usr/lib/arm-linux-gnueabihf/jni/libjnidispatch.so -> libjnidispatch_4.2.2.so
I tried removing via apt and reinstalling but it doesn't change anything. Should i reinstall java too?
chapototo
Posts: 4
Joined: 21 Oct 2020, 18:36

Re: [Rpi Buster] JNA Native: java.lang.UnsatisfiedLinkError: Native library (libjnidispatch.so) not found

Post by chapototo »

well, nevermind, i'll stick with the portable version. Thanks !
Post Reply