Search code examples
javamavendlljettyjacob

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. In order to access COM-Objects, I want to use the Java COM Bridge (JACOB). JACOB comes with a .jar and a .dll. I added the .jar to the build path of the project but I don't know exactly what to do with the .dll. While running the webservice, I always get

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? Or is it maybe a problem with the .jar, because com.jacob.com.ComFailException is part of jacob.jar?

Thanks, Chris


Solution

  • 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. The .dll still has to be part of the project.

    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