0

i discovered a really big problem (probably mine?) about the XMPP reconnection process in smack library v4.1.5 (Android) and openfire v4.0.1. I activated the stream management on the client in this way:

XMPPTCPConnection.setUseStreamManagementDefault(true);
XMPPTCPConnection.setUseStreamManagementResumptionDefault(true);

and activated the automatic reconnection in this way:

ReconnectionManager.getInstanceFor(this.xmppConnection).enableAutomaticReconnection();

After the first successfull connection and login, when the internet connection goes down and the reconnection process starts I get the following error:

W/AbstractXMPPConnection: Connection closed with error
    org.jivesoftware.smack.XMPPException$StreamErrorException: conflict You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
    <stream:error><conflict xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1003)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:944)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:959)

The reconnection manager connects and authenticates very well but then I receive the previous error! I tried to change the resource also but nothing, it doesn't work! Someone could help me in understanding what is wrong?

Nicolò
  • 1
  • 1
  • The exception message itself provides you with some guidance: "StreamErrorException: conflict You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions" – Flow Jul 16 '16 at 20:52
  • I know, but no answer found on that link. – Nicolò Jul 16 '16 at 23:55
  • Probably is a bug? The problem seems that I have already a stream openened and resumed, but at the same time i'm kicked out because within the reconnection phase I use the same resource (it is normal). Does someone have experimented the same problem? – Nicolò Jul 18 '16 at 12:33
  • What makes you sure that a stream resumption was tried when you receive the 'conflict' stream error? – Flow Jul 18 '16 at 13:12
  • @Flow Because I send the unacknowledged message correctly. Moreover I see this: 'D/SMACK: SENT (1): D/SMACK: RECV (1): ' – Nicolò Jul 18 '16 at 13:37
  • Some Smack or Openfire developer can answer? Is it a normal behaviour? Or can be fixed? – Nicolò Jul 19 '16 at 12:14

0 Answers0