现象
telnet连接失败
或者
java.net.ConnectException: connection failed: socket,host=localhost,port=8100,tcpNoDelay=1: java.net.ConnectException: Connection refused: connectat com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.connect(AbstractOpenOfficeConnection.java:79)at com.online.doc.service.JOD4DocToPDF.docToPdf(JOD4DocToPDF.java:35)at com.online.doc.service.JOD4DocToPDF.run(JOD4DocToPDF.java:65)
Exception in thread "Thread-0" java.lang.NullPointerExceptionat com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection.disconnect(AbstractOpenOfficeConnection.java:88)at com.online.doc.service.JOD4DocToPDF.docToPdf(JOD4DocToPDF.java:46)at com.online.doc.service.JOD4DocToPDF.run(JOD4DocToPDF.java:65)
解决
运行→cmd,输入:
cd C:\Program Files (x86)\OpenOffice 4\program
回车
再输入
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
回车