Hello everyboy, is there an Tomcat-JNI expert out there ?
The setting:
I have serveral servlets in one Tomcat (4.1.24) instance using different
functions being bundeled in one DLL (.so respectively).
Since native libraries cannot be laoded more than once I wrote
a simple loader like this:
public class Loader
{
public Loader()
{
Loadlib();
System.out.println("Loader: mylib loaded ");
}
static private void Loadlib()
throws UnsatisfiedLinkError
{
try
{
System.loadLibrary("mylib");
}
catch (UnsatisfiedLinkError e) {
System.out.println("exception in Loader: " + e.getMessage());
}
}
}
This loader class is being .jar(ed) and put into the (tomcat-root)/shared/lib-Folder
The issue:
When requesting the servlet even the message "Loader: mylib loaded " is being
displayed
but nevertheless execution fails with a "500-error: unsatisfied link error".
One might guess that the DLL doesn't contain the correct function but if I leave the
native library where it is and code this
static {
System.loadLibrary("mylib"); //Load native.DLL; must be in
$LD_LIBRARY_PATH
}
directly in the servlets JAVA-code the function is being found and executed.
But this doesn't solve the problem for other servlets.
Any Idea ? Could it work with this separate .jar at all ?
TNX in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]