2015-10-16 120 views
1

我有一个问题,使用waffle和tomcat 7启用登录通过Windows身份验证。UnsatisfiedLinkError - 原生库 - jnidispatch.dll

一切工作正常,但每次我部署应用程序,我得到这个错误:

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 

当我重新启动Tomcat,它开始再次合作。但是,我想成为 能够部署应用程序而无需重新启动。

我看到,该文件jnidispatch.dll仍在使用,即使在取消部署后我也无法手动将其删除。

我该怎么办?

回答

1

查看Apache Tomcat HowTo有关在Tomcat下使用JNI时类加载器问题的部分。它说,认为:

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.

所以,现在看来,你的一些库包含本地jnidispatch.dll lib中,你应该搬出罐子或战争到Tomcat的lib文件夹,使人们有可能重新部署你的申请。

+0

谢谢,我将DLL移动到tomcat lib文件夹,并从我的项目中删除了jna.jar依赖项。这样,我可以在不重新启动服务器的情况下部署应用程序。 – henriquels