zhangzhen1979 / JIMU-ConvertPreview

格式转换:用于将常见的文件、图片转换为Pdf、Ofd、Jpg文件。支持对文件加图片水印、文字水印。预览:可以对以上格式在线预览,支持预览水印等。
Apache License 2.0
41 stars 24 forks source link

最新版本打包后,window服务器java -jar启动,接口调用时报错 #3

Closed zhoyou closed 1 year ago

zhoyou commented 1 year ago

服务器版本win7 接口地址:http://ip:8081/api/convert 接口参数: { "inputType": "path", "inputFile": "D:/cvtest/001.docx", "outPutFileName": "001-online", "outPutFileType": "ofd", "writeBackType": "path", "writeBack": { "path": "D:/cvtest/" } }

日志报错: java.lang.NoClassDefFoundError: Could not initialize class com.jacob.com.ComThread at com.thinkdifferent.convertpreview.utils.LocalConvertUtil.doc2PDF(LocalConvertUtil.java:287) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.utils.LocalConvertUtil.process(LocalConvertUtil.java:52) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.utils.ConvertUtil.convertOffice2Pdf(ConvertUtil.java:539) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.service.impl.ConvertServiceImpl.parseInputFile(ConvertServiceImpl.java:319) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.service.impl.ConvertServiceImpl.mergerInputFile(ConvertServiceImpl.java:222) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.service.impl.ConvertServiceImpl.convert(ConvertServiceImpl.java:123) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.service.impl.ConvertServiceImpl.asyncConvert(ConvertServiceImpl.java:90) ~[classes!/:0.7.0] at com.thinkdifferent.convertpreview.service.impl.ConvertServiceImpl$$FastClassBySpringCGLIB$$2d36a398.invoke() ~[classes!/:0.7.0] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.13.jar!/:5.3.13] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) ~[spring-aop-5.3.13.jar!/:5.3.13] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.13.jar!/:5.3.13] at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) ~[spring-aop-5.3.13.jar!/:5.3.13] at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.3.13.jar!/:5.3.13] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_144] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_144] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_144] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_144]

zhangzhen1979 commented 1 year ago

1、默认配置调用本地引擎使用的是jacob模式,需要将utils目录下的dll文件复制到系统system目录下,请参看utils目录下的说明。 2、可以改为使用exe模式。请参看说明文件。