我一直在尝试在 tomcat 上部署 JavaCV 应用程序,但我没有成功,它在第一次运行后返回 UnsatisfiedLinkError。
javax.servlet.ServletException: Servlet.init() for servlet servlets.ImageRecognize threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:722)
root cause
java.lang.UnsatisfiedLinkError: Native Library D:\javacv-bin\windows-x86_64\jniopencv_core.dll already loaded in another classloader
java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1905)
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
java.lang.Runtime.loadLibrary0(Runtime.java:845)
java.lang.System.loadLibrary(System.java:1084)
com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
com.googlecode.javacpp.Loader.load(Loader.java:489)
com.googlecode.javacpp.Loader.load(Loader.java:431)
com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:136)