1 问题描述
做微信在线客服时,连接openfire,跟踪源码,出现如下问题。而且发现起了很多线程。
Exception in thread "httpbind-worker-12" java.lang.IllegalArgumentException: Illegal JID: zx0001@[object HTMLInputElement]/Strophe
at org.xmpp.packet.JID.<init>(JID.java:542)
at org.xmpp.packet.Packet.<init>(Packet.java:94)
at org.xmpp.packet.IQ.<init>(IQ.java:105)
at org.jivesoftware.openfire.SessionPacketRouter.getIQ(SessionPacketRouter.java:86)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:67)
at org.jivesoftware.openfire.http.HttpSession.sendPendingPackets(HttpSession.java:639)
at org.jivesoftware.openfire.http.HttpSession$HttpPacketSender.run(HttpSession.java:1271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: The input is not a valid JID domain part: [object HTMLInputElement]
at org.xmpp.packet.JID.domainprep(JID.java:368)
at org.xmpp.packet.JID.<init>(JID.java:530)
... 9 more
2 解决方案
出现多个线程的原因,是因为我前台js启动了一个定时器,几秒就发起iq请求,
The input is not a valid JID domain part: [object HTMLInputElement]
则表明self.connection.ping.ping(seat,_success, _error);中seat的值是错误的。
本文介绍了一种在使用Openfire作为微信在线客服时遇到的非法JID问题及其解决方案。该问题表现为前台JS定时器频繁发起IQ请求导致多个线程启动,并引发了非法JID异常。文章详细解释了问题原因及如何正确设置连接参数。
8万+

被折叠的 条评论
为什么被折叠?



