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. nignx - docker內nginx 80端口被占用2. debian - docker依賴的aufs-tools源碼哪里可以找到啊?3. docker網絡端口映射,沒有方便點的操作方法么?4. 前端 - ng-view不能加載進模板5. android clickablespan獲取選中內容6. docker容器呢SSH為什么連不通呢?7. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””8. docker綁定了nginx端口 外部訪問不到9. angular.js - angular內容過長展開收起效果10. docker images顯示的鏡像過多,狗眼被亮瞎了,怎么辦?
