Java啟動(dòng)openoffice服務(wù)后拒絕連接
問(wèn)題描述
手動(dòng)啟動(dòng)是沒(méi)有問(wèn)題的,但是如果我用代碼啟動(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
問(wèn)題解答
回答1:報(bào)錯(cuò)信息發(fā)出來(lái)
相關(guān)文章:
1. python小白 關(guān)于類里面的方法獲取變量失敗的問(wèn)題2. thinkPHP5中獲取數(shù)據(jù)庫(kù)數(shù)據(jù)后默認(rèn)選中下拉框的值,傳遞到后臺(tái)消失不見。有圖有代碼,希望有人幫忙3. linux運(yùn)維 - python遠(yuǎn)程控制windows如何實(shí)現(xiàn)4. Python2中code.co_kwonlyargcount的等效寫法5. javascript - 如何用最快的速度C#或Python開發(fā)一個(gè)桌面應(yīng)用程序來(lái)訪問(wèn)我的網(wǎng)站?6. django - Python error: [Errno 99] Cannot assign requested address7. mysql數(shù)據(jù)庫(kù)做關(guān)聯(lián)一般用id還是用戶名8. [python2]local variable referenced before assignment問(wèn)題9. 求救一下,用新版的phpstudy,數(shù)據(jù)庫(kù)過(guò)段時(shí)間會(huì)消失是什么情況?10. python小白,關(guān)于函數(shù)問(wèn)題
