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. dockerfile - 为什么docker容器启动不了?2. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?3. javascript - 修改表单多选项时和后台同事配合的问题。4. nignx - docker内nginx 80端口被占用5. docker gitlab 如何git clone?6. golang - 用IDE看docker源码时的小问题7. docker安装后出现Cannot connect to the Docker daemon.8. javascript - weex和node,js到底是怎样一个关系呢?9. 我在centos容器里安装docker,也就是在容器里安装容器,报错了?10. docker绑定了nginx端口 外部访问不到

网公网安备