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. javascript - 百度坐标,返回目标附近有哪些坐标2. html5 - 只用CSS如何实现input框的宽度随框里输入的内容长短自动适应?3. javascript - 关于jsp中嵌入js代码的问题4. PHP类中的$this5. html - 急求,能否用flex或者高端点的CSS来布局这个图呢?不想用浮动或定位了6. java - 微信开发遇到一个 bug。。access_token 有关的7. Python操作sqlserver是异步的吗?8. python 正则表达式提取9. python - 这句是什么错误?10. angular.js - angularjs 百度统计怎么统计

网公网安备