简体   繁体   English

在Maven动态Web项目中部署/包含.dll(JACOB)(在码头上部署)

[英]Deploying/including .dll (JACOB) in maven dynamic web project (deployed on jetty)

I'm running a maven dynamic web project, which is deployed in jetty. 我正在运行一个在码头部署的Maven动态Web项目。 In order to access COM-Objects, I want to use the Java COM Bridge (JACOB). 为了访问COM对象,我想使用Java COM Bridge(JACOB)。 JACOB comes with a .jar and a .dll. JACOB带有.jar和.dll。 I added the .jar to the build path of the project but I don't know exactly what to do with the .dll. 我将.jar添加到项目的构建路径中,但我不知道该怎么处理.dll。 While running the webservice, I always get 在运行Web服务时,我总是得到

java.lang.ClassNotFoundException: com.jacob.com.ComFailException. java.lang.ClassNotFoundException:com.jacob.com.ComFailException。

How do I make sure that the .dll will be deployed on the webserver and can be used by the webservice? 如何确保.dll将部署在Web服务器上并可以被Web服务使用? Or is it maybe a problem with the .jar, because com.jacob.com.ComFailException is part of jacob.jar? 还是.jar可能有问题,因为com.jacob.com.ComFailException是jacob.jar的一部分?

Thanks, Chris 谢谢克里斯

I've found the solution. 我找到了解决方案。 I had to install the .jar and .dll via mvn install and add the dependencies manually to the pom-File of the maven web project. 我必须通过mvn install安装.jar和.dll,并将依赖项手动添加到Maven Web项目的pom-File中。 The .dll still has to be part of the project. .dll仍然必须是项目的一部分。

C:\Users\antes>mvn install:install-file -Dfile=C:\jacob.jar -DgroupId=jacob -DartifactId=jacob-jar  -Dversion=4.2 -Dpackaging=jar -DgeneratePom=true


 C:\>mvn install:install-file -Dfile=C:\jacob-1.18-M2-x86.dll -DgroupId=jacob -DartifactId=jacob-dll  -Dversion=4.2 -Dpackaging=dll -DgeneratePom=true

Regards, Chris 克里斯,问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM