powered by Jive Software

Browser based XMPP Client

Hi all,

I am creating a browser based messenger(with ajax). It would connect to the appserver, which creates an XMPPConnection instance per client and talks on the clients behalf to the wildfire server.

Everything was fine. till I tried to run multiple connection. When I run a create a second XMPPConnection object I get the following error:

stream:error (conflict)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:336)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:45)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:77)

In the code, I’‘m creating two XMPPConnections; one to the local wildfire server and another to the gmail’‘s server. I’'ve started suspecting if this is a limitation of smack. *Can we have multiple XMPPConnection objects, connected to multiple servers, in the same jvm?

Any answer would be greatly appreciated. I’'m chasing a deadline and this problem has cropped up.

Thanks in advance,


Got the answer. The problem was because of Tomcat, which was caching sessions across restarts. Hence, with those sessions, the earlier opened connections were alive, leading to the above situation.



Message was edited by: er_vijayv