Java启动openoffice服务后拒绝连接
问题描述
手动启动是没有问题的,但是如果我用代码启动服务后,报connection refused错误
public static String soffice_host = '127.0.0.1';public static String soffice_port = '8100';public static Process pro = null;String commands = 'cmd.exe /C C:Program Files (x86)OpenOffice4programstartOpenoffice.bat';System.out.println(commands);pro = Runtime.getRuntime().exec(commands); connection = new SocketOpenOfficeConnection(soffice_host,Integer.parseInt(soffice_port));System.out.println('获得连接'+connection);connection.connect();
可以打印出连接connection的内容,但是之后连接的时候报错
starOpenoffice.bat内容:soffice -headless -accept='socket,host=127.0.0.1,port=8100;urp;' -nofirststartwizard
手动启动方法:cd C:Program Files (x86)OpenOffice4programsoffice -headless -accept='socket,host=127.0.0.1,port=8100;urp;' -nofirststartwizard
问题解答
回答1:报错信息发出来
相关文章:
1. Mysql取下一条记录2. notepad+编写的html,打开就是这样了。为什么,大神们3. 求助一个Android控件名称4. Chrome-org.openqa.selenium.WebDriverException:未知错误:无法在driver.manage()window()maximize();处获得自动化扩展5. javascript 如何下载一个excel文件 ?6. mysql federated引擎无法开启7. python 如何打印bytes以16进制输出8. python 操作mysql如何经量防止自己的程序在之后被恶意注入(说白了就是问一下python防注入的一些要点)9. javascript - vue-resource 如何二次封装10. python对8000行csv添加列

网公网安备