javatomcatdlljava-native-interfacewaffle

UnsatisfiedLinkError - Native Library - jnidispatch.dll


I have a problem using waffle and tomcat 7 to enable login via windows authentication.

Everything is working fine but everytime I deploy the application, I get this error:

java.lang.UnsatisfiedLinkError: Native Library C:\Program Files    (x86)\Apache Software Foundation\Tomcat 7.0\work\Catalina\localhost\seedInventory\loader\com\sun\jna\win32-x86\jnidispatch.dll already loaded in another classloader

When I restart tomcat, it started working again. However, I want to be able to deploy the application without restarting.

I see that this file jnidispatch.dll is still being used even after the undeploy and I can't delete it manually.

What could I do?


Solution

  • Take a look at Apache Tomcat HowTo section about classloader problems when using JNI under Tomcat. It says, that:

    The important thing to know about using JNI under Tomcat is that one cannot place the native libraries OR their JNI interfaces under the WEB-INF/lib or WEB-INF/classes directories of a web application and expect to be able to reload the webapp without restarting the server.

    So, it seems, that some of your libraries contains a native jnidispatch.dll lib, which you should move out of jar or war into Tomcat's lib folder, to make it possible to redeploy you application.