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. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?2. java - idea如何不显示.idea target这些文件夹3. apache - 想把之前写的单机版 windows 软件改成网络版,让每个用户可以注册并登录。类似 qq 的登陆,怎么架设服务器呢?4. dockerfile - [docker build image失败- npm install]5. javascript - [,null]是什么用法6. docker-compose中volumes的问题7. java - 对于jsp技术,aspx技术的困惑8. apache - 怎么给localhost后面默认加上8080端口9. docker-compose 为何找不到配置文件?10. javascript - vue vue-router 报$router重复定义
