I want do call with JNI a C-DLL from a Servlet, but I got a java.lang.UnsatisfiedLinkError. As standalone-programm with an application it works perfect. When I analyse System-Calls, I found out, that the DLLs would be called, but the Wrapper-DLL would be closed, before the C-DLL are opened!!!
Marcus Beattie I encountered this exact problem, with the same symptoms on both Linux and NT/Win2k:
- A standalone Java program runs the native code fine
- System.loadLibrary("X") succeeds
- An UnsatisfiedLinkError occurs on attempting to use any of the native methods from inside the servlet.
I was using JDK 1.1.8 previously. Upgrading to JDK 1.3 immediately fixed the problem on both NT and Linux. This with Tomcat 3.2, and IBM's JDKs on both platforms.