我使用documents4j将docx转换为PDF,在IDEA中运行时,一切都找到了,但是当我用maven或jenkins运行测试时,出现错误:
java.lang.IllegalStateException: Shutdown in progress
at java.base/java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82) ~[na:na]
at java.base/java.lang.Runtime.removeShutdownHook(Runtime.java:242) ~[na:na]
at com.documents4j.job.ConverterAdapter.deregisterShutdownHook(ConverterAdapter.java:121) ~[documents4j-util-conversion-1.1.5.jar:na]
at com.documents4j.job.ConverterAdapter.cleanUp(ConverterAdapter.java:107) ~[documents4j-util-conversion-1.1.5.jar:na]
at com.documents4j.job.ConverterAdapter.shutDown(ConverterAdapter.java:98) ~[documents4j-util-conversion-1.1.5.jar:na]
at com.documents4j.job.LocalConverter.shutDown(LocalConverter.java:109) ~[documents4j-local-1.1.5.jar:na]
at com.documents4j.job.ConverterAdapter$ConverterShutdownHook.run(ConverterAdapter.java:134) ~[documents4j-util-conversion-1.1.5.jar:na]
我的 pom.xml 是这样的:
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-local</artifactId>
<version>1.1.5</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-transformer-msoffice-word</artifactId>
<version>1.1.5</version>
</dependency>