Web services, Tomcat 5, JNI and HP-UX - UnsatisfiedLinkError

I am running Web Services on Tomcat 5.0 on HP-UX. I am interfacing a very simple web service to a C program with JNI (JVM 1.4.2). The web service works just fine. I followed all the instructions on the HP web site on how to create a JNI C program, compile it into a shared library and set the SHLIB_PATH so java can reference the library. When I try to run the C program from the web service, I get this error in the logfile:

java.lang.UnsatisfiedLinkError: no LearnerInquiry in java.library.path

This is the Java wrapper which calls the C program, the error points to the loadLibrary method:

package HughSFSBridge;

publicclass CISAMDataAccess{

static{

System.loadLibrary("LearnerInquiry");

}

publicnative String LearnerInquiry(String aSIN);

}

* SHLIB_PATH is set to SHLIB_PATH=/home/tomcat/tomcat-jwsdp-1.4/lib

* The name of the library is called LearnerInquiry.sl

Here is what I have tried:

- set & export SHLIB_PATH in the shell and run tomcat from the shell

- set & export LD_LIBRARY_PATH is the shell and run tomcat

- modify catalina.sh to have -Djava.library.path="$SHLIB"

- put the library file in the tomcat /bin directory

- I do **not** have access to the java lib directory, nor should I. This library should only be available to tomcat.

Here are some things I suspect:

- TOMCAT does not pay attention to the SHLIB_PATH

- setting SHLIB_PATH on the command line does not allow tomcat to get access to it

- the package name in the Java wrapper (above) causes name issues

Any suggestions?

[1974 byte] By [d1camero] at [2007-9-30 17:39:17]
# 1

There were two problems:

1. set SHLIB_PATH to the directory which contains the shared library

2. prefix the name of the shared library with "lib"

So if the library was called ***** in the /home/fubar directory:

Path:SHLIB_PATH=/home/fubar

Lib name:libQueer.sl

Java call:System.loadLibrary("*****")

d1

d1camero at 2007-7-6 14:07:52 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
I would also like to point out that if the package name for the java program and associated header are at all out of sequence, it will give a VERY similar unsatisfiedLink exception.
d1camero at 2007-7-6 14:07:52 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...