0

I'm creating a simple web application in java servlet which need to call some C code through jni. The application have already run properly on localhost, but I have some troubles deploy it on the server. After I made the war file and deploy it on the server. I always got these errors.

java.lang.NoClassDefFoundError: Could not initialize class
demoServlet.doPost(demoServlet.java:55)
demoServlet.doGet(demoServlet.java:36)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

Here is what I have been tried: 1. scp my local lib.so to server 2. export server's LD_LIBRARY_PATH to the lib.so path.

But still I got this error from the web application, I'm sensing it's the reason I did'n configure my native library path well. I have tried block the static{System.loadLibrary("");} and the application can go through the initialization process. Please help

  • possible duplicate of [System.loadLibrary() returns exception from static block](http://stackoverflow.com/questions/16728586/system-loadlibrary-returns-exception-from-static-block) – Salil May 11 '14 at 03:58
  • read http://wiki.apache.org/tomcat/HowTo – Java42 May 15 '14 at 00:49

0 Answers0