jodConverter 4.2.2
Windows 10
适用于Java JDK的Amazon Corretto 8 1.8.0_212
从IntelliJ社区(最新)运行
LibreOffice 6.1.3.1(64位)-已安装且运行正常
我尝试运行以下简单代码(请原谅格式错误)
import org.jodconverter.office.OfficeManager;
import org.jodconverter.office.LocalOfficeManager;
import org.jodconverter.JodConverter;
import org.jodconverter.office.OfficeUtils;
import java.io.File;
public class Main {
public static void main(String[] args) {
OfficeManager officeManager = LocalOfficeManager.builder()
.install()
.officeHome("C:\\Program Files\\LibreOffice")
.build();
File inputFile = new File("c:\\users\\dlawler\\desktop\\test.rtf");
File outputFile = new File("c:\\users\\dlawler\\desktop\\test.pdf");
try {
// Start an office process and connect to the started instance (on port 2002).
officeManager.start();
// Convert
JodConverter
.convert(inputFile)
.to(outputFile)
.execute();
} catch (OfficeException e) {
} finally {
// Stop the office process
OfficeUtils.stopQuietly(officeManager);
}
}
}
我收到一个错误,并在屏幕上弹出:
LoadLibrary失败,错误87:参数不正确
这是日志:
“ C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ bin \ java.exe”“” -javaagent:C:\ Program Files \ JetBrains \ IntelliJ IDEA Community Edition 2018.3.6 \ lib \ idea_rt.jar = 51201:C:\ Program Files \ JetBrains \ IntelliJ IDEA社区版2018.3.6 \ bin“ -Dfile.encoding = UTF-8 -classpath” C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ charsets .jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jl \ lib \ ext \ access-bridge-64.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ cldrdata.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ dnsns.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ jaccess .jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jl \ lib \ ext \ jfxrt.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ localedata.jar ; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ nashorn.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ sunec.jar; C :\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ sunjce_provider.jar; C:\ Program File s \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ sunmscapi.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ sunpkcs11.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ ext \ zipfs.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ jce.jar; C:\ Program Files \ Amazon Corretto \ jdk1 .8.0_212 \ jre \ lib \ jfxswt.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ jsse.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ management-agent.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ resources.jar; C:\ Program Files \ Amazon Corretto \ jdk1.8.0_212 \ jre \ lib \ rt。 jar; C:\ Projects \ Converter \ out \ production \ Converter; C:\ Users \ dlawler.m2 \ repository \ org \ jodconverter \ jodconverter-local \ 4.2.2 \ jodconverter-local-4.2.2.jar; C: \ Users \ dlawler.m2 \ repository \ org \ jodconverter \ jodconverter-core \ 4.2.2 \ jodconverter-core-4.2.2.jar; C:\ Users \ dlawler.m2 \ repository \ commons-io \ commons-io \ 2.6 \ commons-io-2.6.jar; C:\ Users \ dlawler.m2 \ repository \ org \ apache \ commons \ commons-lang3 \ 3.7 \ commons-lang3-3。 7.jar; C:\ Users \ dlawler.m2 \ repository \ com \ google \ code \ gson \ gson \ 2.8.5 \ gson-2.8.5.jar; C:\ Users \ dlawler.m2 \ repository \ org \ openoffice \ juh \ 4.1.2 \ juh-4.1.2.jar; C:\ Users \ dlawler.m2 \ repository \ org \ openoffice \ jurt \ 4.1.2 \ jurt-4.1.2.jar; C:\ Users \ dlawler.m2 \ repository \ org \ openoffice \ ridl \ 4.1.2 \ ridl-4.1.2.jar; C:\ Users \ dlawler.m2 \ repository \ org \ openoffice \ unoil \ 4.1.2 \ unoil-4.1.2 .jar; C:\ Users \ dlawler.m2 \ repository \ org \ slf4j \ slf4j-api \ 1.7.25 \ slf4j-api-1.7.25.jar; C:\ Program Files \ JetBrains \ IntelliJ IDEA Community Edition 2018.3。 6 \ lib \ slf4j-log4j12-1.7.25.jar; C:\ Program Files \ JetBrains \ IntelliJ IDEA社区版2018.3.6 \ lib \ log4j.jar; C:\ Program Files \ LibreOffice \ program \ classes \ java_uno。 jar; C:\ Program Files \ LibreOffice \ program \ classes \ juh.jar; C:\ Program Files \ LibreOffice \ program \ classes \ jurt.jar“ com.connexin.converter.Main 2019-07-03 17:21:40 INFO OfficeProcessManager:294-提交任务'开始'并等待... 2019-07-03 17:21:40 INFO OfficeDescriptor:97-部门信息(来自exec路径):产品:LibreOffice-版本:??? -useLongOptionNameGnuStyle:true 2019-07-03 17:21:40 INFO OfficeProcess:395-使用acceptString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1; urp; StarOffice.ServiceManager'和profileDir'C:\ Users \ dlawler \ AppData \ Local \ Temp.jodconverter_socket_host-127.0.0.1_port-2002_tcpNoDelay-1' 2019-07-03 17:21:40 DEBUG AbstractProcessManager:140-命令行匹配!返程pid:25300 2019-07-03 17:21:40 INFO OfficeProcess:402-开始的流程; pid = 25300 2019-07-03 17:21:40调试OfficeConnection:91-使用connectString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'连接 2019-07-03 17:21:42调试OfficeConnection:91-使用connectString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'连接 2019-07-03 17:21:43调试OfficeConnection:91-使用connectString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'连接 2019-07-03 17:21:44调试OfficeConnection:91-使用connectString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'连接 2019-07-03 17:21:45调试OfficeConnection:91-使用connectString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'连接 2019-07-03 17:21:47调试OfficeConnection:91-使用connectString'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'连接 2019-07-03 17:21:48调试OfficeProcessManager:303-SubmitAndWait中捕获了ExecutionException java.util.concurrent.ExecutionException:org.jodconverter.office.OfficeException:Office进程因退出代码-1073740791而终止 在java.util.concurrent.FutureTask.report(FutureTask.java:122) 在java.util.concurrent.FutureTask.get(FutureTask.java:192) 在org.jodconverter.office.OfficeProcessManager.submitAndWait(OfficeProcessManager.java:299) 在org.jodconverter.office.OfficeProcessManager.startAndWait(OfficeProcessManager.java:254) 在org.jodconverter.office.OfficeProcessManagerPoolEntry.doStart(OfficeProcessManagerPoolEntry.java:168) 在org.jodconverter.office.AbstractOfficeManagerPoolEntry.start(AbstractOfficeManagerPoolEntry.java:144) 在org.jodconverter.office.AbstractOfficeManagerPool.doStart(AbstractOfficeManagerPool.java:188) 在org.jodconverter.office.AbstractOfficeManagerPool.start(AbstractOfficeManagerPool.java:113) 在org.jodconverter.office.LocalOfficeManager.start(LocalOfficeManager.java:38) 在com.connexin.converter.Main.main(Main.java:23) 由以下原因引起:org.jodconverter.office.OfficeException:Office进程因退出代码-1073740791而终止 在org.jodconverter.office.ConnectRetryable.attempt(ConnectRetryable.java:87) 在org.jodconverter.office.AbstractRetryable.execute(AbstractRetryable.java:57) 在org.jodconverter.office.ConnectRetryable.execute(ConnectRetryable.java:26) 在org.jodconverter.office.OfficeProcessManager.doStartProcessAndConnect(OfficeProcessManager.java:104) 在org.jodconverter.office.OfficeProcessManager.access $ 100(OfficeProcessManager.java:40) 在org.jodconverter.office.OfficeProcessManager $ 4.call(OfficeProcessManager.java:261) 在org.jodconverter.office.OfficeProcessManager $ 4.call(OfficeProcessManager.java:256) 在java.util.concurrent.FutureTask.run(FutureTask.java:266) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624) 在java.lang.Thread.run(Thread.java:748) 由以下原因引起:org.jodconverter.office.OfficeConnectionException:连接失败:'socket,host = 127.0.0.1,port = 2002,tcpNoDelay = 1'; java.net.ConnectException:连接被拒绝:connect 在org.jodconverter.office.OfficeConnection.connect(OfficeConnection.java:170) 在org.jodconverter.office.ConnectRetryable.attempt(ConnectRetryable.java:61) ...还有10个 引起原因:com.sun.star.connection.NoConnectException:java.net.ConnectException:拒绝连接:connect 在com.sun.star.lib.connections.socket.socketConnector.connect(socketConnector.java:144) 在com.sun.star.comp.connections.Connector.connect(Connector.java:119) 在org.jodconverter.office.OfficeConnection.connect(OfficeConnection.java:106) ...另外11个 2019-07-03 17:21:48 INFO AbstractOfficeManagerPool:195-停止办公室经理池... 2019-07-03 17:21:48 INFO OfficeProcessManager:294-提交任务'停止'并等待... 2019-07-03 17:21:48调试OfficeProcessManager:138-doStopProcess中捕获了异常 java.lang.NullPointerException 在org.jodconverter.office.OfficeProcessManager.doStopProcess(OfficeProcessManager.java:124) 在org.jodconverter.office.OfficeProcessManager.access $ 000(OfficeProcessManager.java:40) 在org.jodconverter.office.OfficeProcessManager $ 5.call(OfficeProcessManager.java:283) 在org.jodconverter.office.OfficeProcessManager $ 5.call(OfficeProcessManager.java:278) 在java.util.concurrent.FutureTask.run(FutureTask.java:266) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624) 在java.lang.Thread.run(Thread.java:748) 2019-07-03 17:21:48 INFO OfficeProcess:206-试图强行终止进程:'host = 127.0.0.1,port = 2002,tcpNoDelay = 1'; pid:25300 2019-07-03 17:21:48 INFO OfficeProcessManager:158-进程被强制终止,代码为-1073740791 2019-07-03 17:21:48 INFO OfficeProcessManager:77-进程退出,代码为-1073740791 2019-07-03 17:21:48调试OfficeProcess:123-删除实例配置文件目录'C:\ Users \ dlawler \ AppData \ Local \ Temp.jodconverter_socket_host-127.0.0.1_port-2002_tcpNoDelay-1' 2019-07-03 17:21:48调试OfficeProcessManager:300-任务'停止'成功执行 2019-07-03 17:21:48 INFO AbstractOfficeManagerPool:213-Office Manager已停止
以退出代码0结束的过程
任何关于寻找什么的想法都将受到感激。我想知道Symantec是否阻止了端口? 64位/ 32位不匹配?
答案 0 :(得分:0)
因此,这必须是本地配置/系统错误。我在另外两台PC上(不在我们的公司网络中)设置了相同的环境,并且jodconverter编译并运行了它的测试没有问题。我正在研究任何可能的差异(防火墙,防病毒,其他加载的程序),这些差异可以解释不同的行为...
更新:原来是这台机器上的超旧AMD显卡(AMD Radeon HD 7300)的驱动程序。解决方案是进入C:\ Windows \ System32,并将atig6pxx.dll重命名为atig6pxx.dll.bak。执行此操作后,我没有遇到任何问题-但我希望此操作会禁用此卡的opengl。目前这不是问题。