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 - js中递归与for循环同时发生的时候,代码的执行顺序是怎样的?2. 小程序怎么加外链,语句怎么写!求救新手,开文档没发现3. python - linux怎么在每天的凌晨2点执行一次这个log.py文件4. php如何获取访问者路由器的mac地址5. 如何分别在Windows下用Winform项模板+C#,在MacOSX下用Cocos Application项目模板+Objective-C实现一个制作游戏的空的黑窗口?6. javascript - jQuery each 方法第三个参数args 如何解释?7. javascript - 在 vue里面用import引入js文件,结果为undefined8. android - 键盘遮挡RecyclerView9. javascript - ...mapGetters和...mapState获取到的state,怎么拿来在methods中操作?10. [python2]local variable referenced before assignment问题
