Java啟動(dòng)openoffice服務(wù)后拒絕連接
問題描述
手動(dòng)啟動(dòng)是沒有問題的,但是如果我用代碼啟動(dòng)服務(wù)后,報(bào)connection refused錯(cuò)誤
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的內(nèi)容,但是之后連接的時(shí)候報(bào)錯(cuò)
starOpenoffice.bat內(nèi)容:soffice -headless -accept='socket,host=127.0.0.1,port=8100;urp;' -nofirststartwizard
手動(dòng)啟動(dòng)方法:cd C:Program Files (x86)OpenOffice4programsoffice -headless -accept='socket,host=127.0.0.1,port=8100;urp;' -nofirststartwizard
問題解答
回答1:報(bào)錯(cuò)信息發(fā)出來
相關(guān)文章:
1. android - Genymotion 微信閃退 not find plugin.location_google.GoogleProxyUI2. mac里的docker如何命令行開啟呢?3. html5 - 微信瀏覽器視頻播放失敗4. javascript - 單個(gè)控件多個(gè)字段搜索5. android webview返回自動(dòng)刷新6. docker綁定了nginx端口 外部訪問不到7. html - 特殊樣式按鈕 點(diǎn)擊按下去要有凹下和彈起的效果8. objective-c - iOS開發(fā)使用什么對html進(jìn)行代碼高亮9. angular.js - 關(guān)于ng-model和ng-bind的疑問10. javascript - npm安裝報(bào)錯(cuò) 系統(tǒng)w7 求大神解答
