2016-07-03 83 views
8

我有一個Java應用程序實現了Smack 4.1.7,我用它作爲Openfire 4.0.2的模擬客戶端。目前,Openfire正在我的本地主機上運行。 啪可以登錄並正確使用此連接進行驗證:當拍擊嘗試創建或加入一個MUC,請求超時(SmackException $ NoResponseException)和Openfire的本地主機上Smack和Openfire之間的路由錯誤

XMPPTCPConnectionConfiguration conf = XMPPTCPConnectionConfiguration.builder() 
     .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled) 
     .setServiceName(XMPP_HOST_NAME) // equals xmppDomain on server 
     .setUsernameAndPassword("user1", "pwd1") 
     .setResource("tester") 
     .setDebuggerEnabled(true) 
     .build(); 

現在記錄以下內容:

2016.07.03 18:58:54 org.jivesoftware.openfire.spi.RoutingTableImpl - 
Unable to route packet. Packet should only be sent to available sessions and the 
route is not available. 
<presence id="WrkXH-6" from="[email protected]/tester" to="[email protected]/tester"> 
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="NfJ3flI83zSdUDzCEICtbypursw="/> 
</presence> 
2016.07.03 18:58:54 org.jivesoftware.openfire.spi.RoutingTableImpl - 
Failed to route packet to JID: [email protected]/tester packet: 
<presence id="WrkXH-6" from="[email protected]/tester" to="[email protected]/tester"> 
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="NfJ3flI83zSdUDzCEICtbypursw="/> 
</presence> 

我已經在服務器端和客戶端使用「localhost」,「127.0.0.1」和我的機器名稱作爲XMPP_HOST_NAME,並且我一直得到相同的錯誤。任何幫助,將不勝感激。

+0

對不起,您是否已經與用戶完成登錄?本地主機不起作用,機器名稱(但你必須檢查控制面板中的openfire服務器名稱)將起作用。對我來說,來自同一個人的存在似乎很奇怪,但我必須檢查 – MrPk

+0

是的,登錄工作正常。它與localhost,127.0.0.1和機器名稱(不管在openfire side btw配置了什麼)一起工作。建立連接時,Smack端會有警告:org.jivesoftware.smack.util.DNSUtil resolveDomain 警告:在爲本地主機resovling SRV記錄時出現異常。考慮添加'_xmpp-(服務器|客戶端)._ tcp'DNS SRV記錄,但從該連接和身份驗證的appart都可以。 – guik

+0

也許你有一個代理服務器,你必須添加本地主機(是,127.0.0.1)作爲例外... – MrPk

回答

0

我發現了這個問題和一個錯誤。 如何處理:

的Openfire有2個值:

http.connection.timeout 
http.socket.timeout 

都設置好的了,如果在性能不可用的2000/3000/5000的毫秒的默認值。

因此,需要通過管理控制檯(或數據庫)將此值設置爲更高的值,例如15000/20000或更高。

更多,在Openfire的在4.0.2(廣告很可能舊版本太)的index.jsp有一個調用來檢查的RSSFeed默認情況下啓用),但這一呼籲將這些值重置爲3000,所以基本上超時將是無用的。

要禁用的RSSFeed設置爲

rss.enabled 

然後重啓Openfire的。