所以我有一个外部jar依赖项是一个非REST的Java RESTEasy应用程序。所以,我在我的pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>install-external-non-maven-jar</id>
<phase>clean</phase>
<configuration>
<repositoryLayout>default</repositoryLayout>
<groupId>com.dynamsoft</groupId>
<artifactId>barcode</artifactId>
<version>1.0</version>
<file>${project.basedir}/lib/com.dynamsoft.barcode.jar</file>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>
并添加了此依赖项
<dependency>
<groupId>com.dynamsoft</groupId>
<artifactId>barcode</artifactId>
<version>1.0</version>
</dependency>
所有这一切都很好...如果我强制使用maven重新加载工件,它似乎发现它很好,甚至在barcode-1.0.jar
中包含nis.war/WEB-INF/lib/
,其中包含我需要的类(我'甚至进去并手动检查罐子添加)。每当我调用依赖类时,我会得到这个堆栈跟踪:
java.lang.UnsatisfiedLinkError: com.dynamsoft.barcode.BarcodeReader.nativeCreateInstance()J
com.dynamsoft.barcode.BarcodeReader.nativeCreateInstance(Native Method)
com.dynamsoft.barcode.BarcodeReader.<init>(BarcodeReader.java:33)
com.corista.nis.web.resources.Slides.getLabelDataForSlideByID(Slides.java:507)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
从我可以放在一起,它认为它可能无法找到库文件。库文件虽然包含在依赖的jar文件中,所以我不完全相信......有什么想法吗?