我有一個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,並且我一直得到相同的錯誤。任何幫助,將不勝感激。
對不起,您是否已經與用戶完成登錄?本地主機不起作用,機器名稱(但你必須檢查控制面板中的openfire服務器名稱)將起作用。對我來說,來自同一個人的存在似乎很奇怪,但我必須檢查 – MrPk
是的,登錄工作正常。它與localhost,127.0.0.1和機器名稱(不管在openfire side btw配置了什麼)一起工作。建立連接時,Smack端會有警告:org.jivesoftware.smack.util.DNSUtil resolveDomain 警告:在爲本地主機resovling SRV記錄時出現異常。考慮添加'_xmpp-(服務器|客戶端)._ tcp'DNS SRV記錄,但從該連接和身份驗證的appart都可以。 – guik
也許你有一個代理服務器,你必須添加本地主機(是,127.0.0.1)作爲例外... – MrPk