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. 如何判断数据库的库和表是否存在?2. javascript - vue-router怎么不能实现跳转呢3. 求救一下,用新版的phpstudy,数据库过段时间会消失是什么情况?4. html5 - vue SPA 项目如果组件过多,岂不是打包的文件太大5. css - chrome下a标签嵌套img 显示会多个小箭头?6. javascript - H5 audio 标签 如何实现音乐播放在 跨页面 的时候是连续播放的(不重新开始)7. python - 字符串里的u’u00a1’怎么打印成中文8. 求解改变某值9. MySQl 管理不了数据库,要怎么解决10. javascript - 关于js原生事件的绑定与解除绑定

网公网安备