• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 851
  • Last Modified:

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
0
simoncox
Asked:
simoncox
  • 2
1 Solution
 
int_20hCommented:
Try adding /usr/local/lib  to the PATH environment when starting tomcat.  Also, check if tomcat overwrites PATH when it's starts up.  Check the startup.sh or catalina.sh and search for PATH/java.libary.path
0
 
simoncoxAuthor Commented:
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!
0
 
int_20hCommented:
THX simoncox!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now