gpt4 book ai didi

java.io.EOFException : no more data available - expected end tag to close start tag 异常

转载 作者:搜寻专家 更新时间:2023-10-31 20:19:48 37 4
gpt4 key购买 nike

我正在使用 xmpp 开发聊天应用程序,根据我们的要求,我们有三台服务器 Apache Tomcat 7、ejabbered 2.1.11 和 mysql 5.5,

to run xmppbot on tomcat  used below library
-Smack-core-4.0.3.jar
-smack-tcp-4.0.3.jar
-xlightweb2.5.jar
-xpp3-1.1.3.3.jar
-xSocket-2.4.6.jar

使用上面的库,我能够连接到 ejabberd 并能够使用我的登录 ID 和密码登录,但是在登录一段时间后,连接会自动关闭,并且正在获取低于堆栈跟踪

Sep 16, 2014 4:36:01 PM org.jivesoftware.smack.XMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection closed with error
java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...</text></error></iq>... @1:1347
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2919)
at org.xmlpull.mxp1.MXParser.more(MXParser.java:2928)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1112)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1061)
at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:279)
at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)
at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)
Sep 16, 2014 4:37:15 PM org.jivesoftware.smack.XMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection closed with error
java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...</text></error></iq>... @1:1347
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2919)
at org.xmlpull.mxp1.MXParser.more(MXParser.java:2928)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1112)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1061)
at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:279)
at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)
at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)

以上消息在我的 eclipse 控制台中不断重复!!!

谁能解释一下

  1. 出现上述错误的原因是什么?
  2. 如何解决上述错误?

提前致谢!!!

最佳答案

您需要设置心跳(ping)间隔以克服空闲连接超时。超时不一定在应用程序中,它们可以在路径中的路由器/交换机中。在示例中,600 表示 10 分钟。

PingManager.getInstanceFor(connection).setPingInterval(600);

关于java.io.EOFException : no more data available - expected end tag </stream:stream> to close start tag <stream:stream> 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25882594/

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