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. html5 - ajax post请求后如何渲染到页面上2. mysql - SQL问个基础例子,书上的,我怎么看都看不懂..谁帮我解释一下第2个为什么和第1个一样?3. javascript - 使用 vuex-router-sync寄存路由信息,this.$router params 不能赋值?4. 求大神帮我看看是哪里写错了 感谢细心解答5. python - django里GROUP BY 如何写这样的mysql语句?6. css - div内部滚动,安卓没有滚动条(非body滚动),有什么办法可以显示吗?7. 数据库安全 - 在公网上部署mysql数据库,安全方面需要做到哪些注意事项8. python - 如何使用jsom.dumps获得完整的json数据?9. 如何判断数据库的库和表是否存在?10. python2.7 - 在Eclipse开发Python,怎么去掉控制台输出的其他消息??
