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. boot2docker無法啟動2. docker-compose中volumes的問題3. docker容器呢SSH為什么連不通呢?4. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””5. java - SSH框架中寫分頁時service層中不能注入分頁類6. docker安裝后出現Cannot connect to the Docker daemon.7. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值8. 關于docker下的nginx壓力測試9. nignx - docker內nginx 80端口被占用10. 老師,按tab鍵不起作用怎么回事

網公網安備