You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Romain Quilici <r....@chem.usyd.edu.au> on 2006/07/04 06:38:40 UTC

Native library not found

Hi all,
I have read several message on this issue, and tried many solutions
without a real success. Actually I can get it working but I am not happy
with that way(explained below).
I must admit that it is a mystery how native libraries are found in Tomcat.
I am running tomcat 5.5.15 with Axis on Linux(FC5), and want to load a
lib.so file.

My library libljackj.so is located under /usr/share/labjack

When I start tomcat, I get the following message
INFO: The Apache Tomcat Native library which allows optimal performance
in production environments was not found on the java.library.path:
/usr/local/jdk1.5.0_06/jre/lib/i386/client:/usr/local/jdk1.5.0_06/jre/lib/i386:/usr/local/jdk1.5.0_06/jre/../lib/i386

So I copied my libljackj.so under /usr/local/jdk1.5.0_06/jre/lib/i386
and it seems to work, the library is loaded. I am not happy with that
because I don't want to pollute  my Java  install dir  with  external
libraries.

So I decided to modify the java.library.path  I tried  two solutions:
1) modifying the /etc/tomcat5/tomcat5.conf and have added as advised in
this file:
LD_LIBRARY_PATH=/usr/share/labjack:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

When Tomcat starts I can see that the directory has been added to the
java.library.path:
INFO: The Apache Tomcat Native library which allows optimal performance
in production environments was not found on the java.library.path:
/usr/local/jdk1.5.0_06/jre/lib/i386/client:/usr/local/jdk1.5.0_06/jre/lib/i386:/usr/local/jdk1.5.0_06/jre/../lib/i386:/usr/share/labjack:

But when trying to load the library I get the standard error
java.lang.UnsatisfiedLinkError: no ljackj in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)

2)modifying  the JAVA_OPTS with
JAVA_OPTS="-Djava.library.path=/usr/share/labjack" $JAVA_OPTS
When Tomcat starts I can see that the directory is in the java.library.path:
INFO: The Apache Tomcat Native library which allows optimal performance
in production environments was not found on the java.library.path:
/usr/share/labjack
And again when trying to load the library I get the standard error
java.lang.UnsatisfiedLinkError: no ljackj in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)

It is a real mystery why in the first case the library is loaded
successfully while in both last case the lib is not found even if the
java.library.path is correct.

Thanks a lot for the help you can provide
Regards
Romain







---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org