org.artofsolving.jodconverter.office.OfficeException: failed to start解决方法

在调用openoffice Manager时候会出现下面的错误
org.artofsolving.jodconverter.office.ProcessPoolOfficeManager 
INFO: ProcessManager implementation is WindowsProcessManager
Exception in thread "main"
org.artofsolving.jodconverter.office.OfficeException: failed to start
and connect
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:
61)
at
org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:
102)
at
org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.start(ProcessPoolOfficeManager.java:
59)
at ImDocConverter.docuConverter.action(docuConverter.java:15)
at ImDocConverter.fileConverter.main(fileConverter.java:41)
Caused by: java.util.concurrent.ExecutionException:
org.artofsolving.jodconverter.office.OfficeException: could not
establish connection
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:
59)
... 4 more
Caused by: org.artofsolving.jodconverter.office.OfficeException: could
not establish connection
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:
123)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.access
$000(ManagedOfficeProcess.java:31)
at org.artofsolving.jodconverter.office.ManagedOfficeProcess
$1.run(ManagedOfficeProcess.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: a process with
acceptString 'socket,host=127.0.0.1,port=2002' is already running; pid
5488
at
org.artofsolving.jodconverter.office.OfficeProcess.start(OfficeProcess.java:
59)
at
org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:
112)
... 8 more

观察到下面这则消息
a process with acceptString 'socket,host=127.0.0.1,port=2002' is already running; pid
5488

说明链接正在被占用,使用$ps -aux|grep openoffice*
找到正在运行的openoffice的进程,使用kill -9 pid(此处为5488)结束掉即可。

你可能感兴趣的:(Linux)