How can i use JNI with WebSphere Application Server (WAS)?

Davanum Srinivas

One problem is that Servlets cannot load libraries because they are in a custom classloader. Move the servlet to a location in the application server classpath. The application server path is automatically set when you install WAS. The default setting for the class path contains all of the Applications Server APIs(the JAR files in the d:WebSphereAppServerlib directory).

Another problem is with finding the DLL's (on Windows) or Shared Objects (on Unix'es). On AIX, set LD_LIBRARY_PATH and LIBPATH. On Solaris, set LD_LIBRARY_PATH. On NT, set PATH. Also, If the servlet can find the JNI DLLs, but not the actual C or C++ function, check your JNI implementation.