在localhost上Smack和Openfire之间的路由错误

时间:2016-07-03 17:06:06

标签: localhost openfire smack

我有一个实现Smack 4.1.7的Java应用程序,我将其用作Openfire 4.0.2的模拟客户端。目前,Openfire正在我的localhost上运行。 Smack可以使用此连接正确登录和验证:

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

现在当Smack尝试创建或加入MUC时,请求超时(SmackException $ NoResponseException)和Openfire会记录以下内容:

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="user1@localhost/tester" to="user1@localhost/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: user1@localhost/tester packet: 
<presence id="WrkXH-6" from="user1@localhost/tester" to="user1@localhost/tester">
    <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="NfJ3flI83zSdUDzCEICtbypursw="/>
</presence>

我使用过&#34; localhost&#34;,&#34; 127.0.0.1&#34;在服务器端和客户端,我的机器名称为XMPP_HOST_NAME,我不断收到相同的错误。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

我发现了问题和一个错误。 如何处理:

Openfire有2个值:

http.connection.timeout
http.socket.timeout 

如果在属性中不可用,则设置默认值为2000/3000/5000毫秒。

因此需要将管理控制台(或数据库)的值设置为更高的值,如15000/20000或更高版本(如果需要)。

更多,在 index.jsp 中的Openfire 4.0.2(也可能是旧版本的广告)中,有一个检查 rssfeed 的调用(默认启用)但是这个调用会将这些值重置为3000,所以基本上超时将是无用的。

禁用rssfeed设置为 false

rss.enabled

然后重新启动Openfire。