Solved

UnsatisfiedLinkException with JNI and Tomcat

Posted on 2004-04-15
3
833 Views
Last Modified: 2013-11-24
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
Comment
Question by:simoncox
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
int_20h earned 250 total points
ID: 10835087
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
 

Author Comment

by:simoncox
ID: 10835416
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
 
LVL 3

Expert Comment

by:int_20h
ID: 10835600
THX simoncox!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now