gpt4 book ai didi

localhost - 本地主机上 Smack 和 Openfire 之间的路由错误

转载 作者:行者123 更新时间:2023-12-04 08:54:51 26 4
gpt4 key购买 nike

我有一个实现 Smack 4.1.7 的 Java 应用程序,我将它用作 Openfire 4.0.2 的模拟客户端。目前,Openfire 正在我的本地主机上运行。
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>

我在服务器端和客户端都使用了“localhost”、“127.0.0.1”和我的机器名称作为 XMPP_HOST_NAME ,我一直收到同样的错误。任何帮助,将不胜感激。

最佳答案

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

Openfire 有两个值:

http.connection.timeout
http.socket.timeout

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

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

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

禁用设置为 的 rssfeed假
rss.enabled

然后重启Openfire。

关于localhost - 本地主机上 Smack 和 Openfire 之间的路由错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38172327/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com