Link to home
Start Free TrialLog in
Avatar of simoncox
simoncox

asked on

UnsatisfiedLinkException with JNI and Tomcat

I have a JSP page calling a method in a seperate class that attempts to load a JNI library.  On System.loadLibrary() I get the following exception:

java.lang.UnsatisfiedLinkError: no 3StoreJNI in java.library.path

My java.library.path is set to '/usr/local/lib:/usr/lib/java:/usr/lib' and in /usr/local/lib is 'lib3StoreJNI.so'.  Calling System.mapLibraryName() gives 'lib3StoreJNI.so'.  The same bit of code works fine outside of Tomcat, so I'm a bit confused as to what is going wrong.  I'm running Tomcat 5.0.18 on a Gentoo linux box, kernel 2.6.1.

Is there anything else I can do to track the problem down?

Thanks,
Simon Cox
ASKER CERTIFIED SOLUTION
Avatar of int_20h
int_20h

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of simoncox
simoncox

ASKER

Well, I managed to get it working.  Adding /usr/local/lib to the PATH didn't help.  Turns out that the JVM wasn't being started with the properties that I thought it was.  I had defined java.library.path in /opt/tomcat/conf/catalina.properties, and this was being loaded at some point.  However, I've now added -Djava.library.path... to the command that starts the JVM and it now works!  I guess you can get the points as it was your post that led me to find the problem.  That, and you answered so DAMN fast!
THX simoncox!