久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

Java啟動(dòng)openoffice服務(wù)后拒絕連接

瀏覽:198日期:2023-10-19 18:06:19

問(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)

標(biāo)簽: java
相關(guān)文章:
主站蜘蛛池模板: 华蓥市| 石柱| 双鸭山市| 遂昌县| 石林| 新野县| 鄱阳县| 诸暨市| 四平市| 嘉峪关市| 古丈县| 外汇| 万州区| 古蔺县| 丰镇市| 许昌县| 吉木萨尔县| 甘泉县| 新田县| 贡嘎县| 湾仔区| 巩留县| 无极县| 曲阳县| 平和县| 双鸭山市| 稷山县| 龙江县| 乌海市| 扬州市| 塘沽区| 玉环县| 兴隆县| 红原县| 益阳市| 朝阳区| 静宁县| 乐安县| 芮城县| 宁阳县| 山阳县|