JNI and web services
Matthew Graham
mjg at cacr.caltech.edu
Wed Apr 14 09:54:28 PDT 2004
Hi,
I have no problem with running a standalone application which uses JNI
where I can set LD_LIBRARY_PATH from the command line. The problem here is
what to do with a web service that uses JNI: the library path seems to
have to be set when Tomcat is started so I can include the path to
libfoo.so in $CATALINA_OPTS but:
- this is system dependent
- what happens if I have a whole suite of libfoo's - I would also have to
stop and restart Tomcat when I added a new one
- this is not easily deployable to other machines where I might not have
control over Tomcat.
In the WS code I tried:
String jlp = System.getProperty("java.library.path");
String newpath = jlp + ":" + <path to libfoo.so>;
System.setProperty("java.library.path", newpath);
which does set java.library.path properly but the subsequent call:
static (System.loadLibrary("foo"))
does not pick the new path up and so I get the UnsatisfiedLinkError.
Cheers,
Matthew
More information about the grid
mailing list