Error "The user connection is no longer active" when using XEP-0198: Stream Management
I'm trying to use XEP-0198: Stream Management with Tigase 5.2, but sometimes getting an error "The user connection is no longer active" and NullPointerException in logs
Here is my scenario:
User1 connected and logged in to Chat, enabled Stream Management
User1 sent a message to User2
User1 sent a **** element and received ****
User1 closed app, but did not logout properly (close stream, close TCP connection)
User2 connected and logged in to Chat, enabled Stream Management
User2 received a message from offline storage
User2 sent a message to User1
User2 got this error:
<error code="404" type="cancel"><item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></item-not-found><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" lang="en">The user connection is no longer active.</text></error>
and server exception
java.lang.NullPointerException at tigase.server.xmppclient.StreamManagementIOProcessor.packetsSent(StreamManagementIOProcessor.java:241) at tigase.xmpp.XMPPIOService.processWaitingPackets(XMPPIOService.java:268) at tigase.server.ConnectionManager.writePacketToSocket(ConnectionManager.java:704) at tigase.server.ConnectionManager.writePacketToSocket(ConnectionManager.java:1094) at tigase.server.xmppclient.ClientConnectionManager.processPacket(ClientConnectionManager.java:158) at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Does it an expected behaviour? I didn't find anything about such error here http://xmpp.org/extensions/xep-0198.html
Added by Igor Khomenko over 4 years ago
so, now I receive an error when trying to send a message to User with broken connection.
Actually it's much better than receive nothing and lose a message completely
Am I right that in 5.3 I I won't be receiving an error message, but it will be stored to the Offline storage?
Added by Andrzej Wójcik over 4 years ago
Yes, this returned error, which you are receiving right now is correct behavior of Tigase XMPP Server 5.2
In Tigase XMPP Server 5.3 logic responsible for handling not delivered messages is changed and will handle packets not delivered due to broken connection in same way as they were sent to offline user. By default Tigase XMPP Server stores messages sent to offline user in offline storage, so your not delivered messages are going to be stored in offline storage as well.