Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#93 UnsatisfiedLinkError for genconfig fails on arm

All
open
rzo
None
5
2014-09-22
2013-12-19
Thomas
No

On raspberry pi (arm hard floating point) will throw the following exception. Nothing to be found in the log files.
Permissions on the folder /opt/yajsw/yajsw-stable-11.08/tmp/jna-root/ are ok, also the process is started with root user.

The temporrary file jna3083017305408300989.tmp is not there after the process is finalized.

root@raspberry-pi:/opt/yajsw/yajsw-stable-11.08/bin# ./genConfig.sh 1741
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1~deb7u1+rpi1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)
YAJSW: yajsw-stable-11.07
OS : Linux/3.6.11+/arm
JVM : Oracle Corporation/1.7.0_25//usr/lib/jvm/java-7-openjdk-armhf/jre/32
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.rzo.yajsw.boot.WrapperExeBooter.main(WrapperExeBooter.java:43)
Caused by: java.lang.UnsatisfiedLinkError: /opt/yajsw/yajsw-stable-11.08/tmp/jna-root/jna3083017305408300989.tmp: /opt/yajsw/yajsw-stable-11.08/tmp/jna-root/jna3083017305408300989.tmp: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1953)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1878)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1839)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:771)
at com.sun.jna.Native.loadNativeLibrary(Native.java:697)
at com.sun.jna.Native.<clinit>(Native.java:127)
at com.sun.jna.Pointer.<clinit>(Pointer.java:42)
at com.sun.jna.PointerType.<init>(PointerType.java:25)
at com.sun.jna.ptr.ByReference.<init>(ByReference.java:32)
at com.sun.jna.ptr.IntByReference.<init>(IntByReference.java:22)
at com.sun.jna.ptr.IntByReference.<init>(IntByReference.java:18)
at org.rzo.yajsw.os.posix.PosixProcess.<init>(PosixProcess.java:43)
at org.rzo.yajsw.os.posix.OperatingSystemPosix.setWorkingDir(OperatingSystemPosix.java:12)
at org.rzo.yajsw.WrapperExe.main(WrapperExe.java:170)
... 5 more

Discussion

  • Thomas
    Thomas
    2014-01-06

    Thank you for the response, I will try the proposals.

     
  • Kidmose
    Kidmose
    2014-09-16

    I'm trying to apply the fix above, but finding my understanding to be lacking.
    Do you care to elaborate a bit/guide me?

    I'm using a raspberry pi with 2014-09-09-wheezy-raspbian.
    $ uname -a
    Linux raspberrypi 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l GNU/Linux

    I've done the following:
    pi@raspberrypi ~ $ cd
    pi@raspberrypi ~ $ mkdir tmp
    pi@raspberrypi ~ $ cd tmp
    pi@raspberrypi ~/tmp $ jar xf ~/<some-app>-server/lib/core/jna/jna-3.4.1.jar com/sun/jna/linux-arm/libjnidispatch.so
    pi@raspberrypi ~/tmp $ sudo mkdir -p /opt/lib/jna
    pi@raspberrypi ~/tmp $ sudo cp com/sun/jna/linux-arm/libjnidispatch.so /opt/lib/jna/
    pi@raspberrypi ~/tmp $ cd ~/<some-app>-server/bin/
    pi@raspberrypi ~/<some-app>-server/bin $ cp setenv.sh setenv.sh.bak
    pi@raspberrypi ~/<some-app>-server/bin $ sudo chmod -w setenv.sh.bak
    pi@raspberrypi ~/<some-app>-server/bin $ editor setenv.sh
    pi@raspberrypi ~/<some-app>-server/bin $ diff setenv.sh.bak setenv.sh
    34c34
    < wrapper_java_sys_options=-Djna_tmpdir="$wrapper_home"/tmp
    ---
    > wrapper_java_sys_options=-Djna_tmpdir="$wrapper_home"/tmp -Djna.nounpack=true -Djna.boot.library.path=/opt/lib/jna

    This seems to go wrong, however:
    pi@raspberrypi ~/<some-app>-server/bin $ sudo ./setenv.sh
    ++++++++++ YAJSW SET ENV ++++++++++
    ./setenv.sh: line 34: -Djna.nounpack=true: command not found
    java version "1.8.0"
    Java(TM) SE Runtime Environment (build 1.8.0-b132)
    Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)
    wrapper home : /home/pi/<some-app>-server
    configuration: /home/pi/<some-app>-server/conf/wrapper.conf
    java version "1.8.0"
    Java(TM) SE Runtime Environment (build 1.8.0-b132)
    Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)

    Any suggestions?
    Thank you so much!

     
  • Kidmose
    Kidmose
    2014-09-17

    Seems like i got this bit figured out (though I'm now stuck on something else)

    In case anyone else is facing the same issues as I was, heres my way arround it:

    Extracting com/sun/jna/linux-arm/libjnidispatch.so and placing it where specified with '-Djna.boot.library.path=/opt/lib/jna' didn't solve it for me, so I moved on to compiling it myself.
    I realised later that the executable bit for /opt/lib/jna/libjnidispatch.so wasn't set - maybe setting this is enough to make it work.

    Transcript of my solution:
    pi@raspberrypi ~ $ sudo apt-get install ant libx11-dev libxt-dev
    pi@raspberrypi ~ $ wget https://github.com/twall/jna/archive/3.4.1.tar.gz
    pi@raspberrypi ~ $ mv 3.4.1.tar.gz jna-3.4.1.tar.gz
    pi@raspberrypi ~ $ tar xvzf jna-3.4.1.tar.gz
    pi@raspberrypi ~ $ cd jna-3.4.1
    pi@raspberrypi ~/jna-3.4.1 $ ant
    # jUnit testcases testCallFloatCallback and testCallDoubleCallback fail, causing "BUILD FAILED" messages, disregard
    pi@raspberrypi ~/jna-3.4.1 $ sudo mkdir -p /opt/lib/jna
    pi@raspberrypi ~/jna-3.4.1 $ sudo cp build/native/libjnidispatch.so /opt/lib/jna/

    and then changing the bin/wrapper.sh:
    pi@raspberrypi ~/smartamm-server/bin $ diff wrapper.sh.bak wrapper.sh
    7c7
    < "$java_exe" "$wrapper_java_options" "$wrapper_java_sys_options" -jar $wrapper_jar" "$@"
    ---
    > "$java_exe" "$wrapper_java_options" "-Djna.boot.library.path=/opt/lib/jna" "$wrapper_java_sys_options" -jar "$wrapper_jar" "$@"

    I suspect '-Djna...' should be added in bin/setenv.sh instead, but I couldn't figure out how to do that. If you can, I'd like to know how.

     
  • rzo
    rzo
    2014-09-21

    hello,

    yajsw-alpha-12.00 should work out of the box on raspberry pi. just tested it on

    Raspbian
    Debian Wheezy
    Version: September 2014

    for the service to start on boot you have to set the wrapper.daemon.update_rc property or to invoke

    update-rc.d -f <service name=""> remove

    to remove the service links and then invoke

    update-rc.d <service name=""> defaults

    reason: yajsw sets per default the execution order to 20 (eg creates the link rc2.d/S20<name>). for some reason raspbian does not seem to boot the service.

    setting the execution order to 01 seems to work.

    -- Ron

     
  • rzo
    rzo
    2014-09-21

    ps: for some reason sourceforge is converting <service name=""> to <service name="">

     
  • Kidmose
    Kidmose
    2014-09-22

    I'm currently using yajsw-stable-11.11, so updating it seems to be a good idea then.
    (Sorry, I forgot to mention that earlier)

    Do you know, off the top of your head, if 11.11 should be expected to fail at starting the service ('sudo startDaemon.sh') on the pi as well?
    (Related to the wrapper.daemon.update_rc property maybe?)

    Thank you very much,
    Egon