jnr / jffi

Java Foreign Function Interface
Apache License 2.0
168 stars 78 forks source link

Fails loading *.so from docker container on raspberry pi #50

Open muka opened 7 years ago

muka commented 7 years ago

Hi, I am using this library (actually jnr-unixsocket) to create a dbus connection in a docker container.

It works outside of a docker container, while fails in it with: (UPDATE) It seems not to work in the host system and neither in the container

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /usr/src/app/tmp/jffi2917909324910245781.so: /usr/src/app/tmp/jffi2917909324910245781.so: cannot open shared object file: No such file or directory

Inspecting the container fs I find the library. I tried changing the java.io.tmpdir but no luck and also set 777 to avoid any permission error.

Relevant sources are here for reference

Do you have any suggestion?

I would be glad to help testing if needed.

Thanks

UPDATE2: Related to #30

muka commented 7 years ago

Found a solution, reporting the steps here

Would make sense to add to the documentation?

nirvdrum commented 7 years ago

It would be best if we just added the built JAR. NB: jnr-constants would also need to be updated, if you're using that project.

@headius @tduehr Do either of you have a Raspberry Pi to build on?

tduehr commented 7 years ago

I do but it's one of the first gen and I don't have it setup currently. I might be able to get my hands on a 2nd gen as well but I don't exactly know when I can get to it. If there's a qemu config to emulate one, that'd be easiest for me.

It seems there is one in the main qemu project now. I'll take a poke when I can.

ryanbreed-tp commented 5 years ago

this may not be entirely relevant, but I've run into the same problem on my tinkerboard using openjdk to run logstash - same architecture, different distribution (armbian). I ensured that I had the following os packages installed, and that seemed to clear it up:

default-jdk-headless
default-jre-headless
libjnr-ffi-java
libjffi-java
libjffi-jni
libasm-java
libjnr-x86asm-java

you might need to do the same if dockerizing for armv7l