We are using Smack 4.2.0 with stream management enable on the server side(Using Ejabbered). At the client side when user trying to resume the previous stream after stream resumption timeout we are getting resume failed error stating previous session timeout.
Connection XMPPTCPConnection[155@xmppalpha.livecare.ca/9039] (0) closed with error
java.lang.IllegalStateException: Could not transform string ‘text’ to XMPPErrorCondition
at org.jivesoftware.smack.packet.XMPPError$Condition.fromString(XMPPError.java:414 )
at org.jivesoftware.smack.sm.provider.ParseStreamManagement.failed(ParseStreamMana gement.java:56)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1130)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:980)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:996)
at java.lang.Thread.run(Thread.java:818)
We are unable to recognize the exception to perform any further action. For creating a new session when previous session has been expired, we should get a specified stream resumption error from smack.
Strictly speaking the XML which is sent by ejabbered is not conform to the specification.
It includes a text element, which is neither described in XEP-0198 (Stream Management) nor specified in its XML schema, which only references the “stanzaErrorGroup”, but not the text element:
I think Smack is correct here
There is a recent opinion within the XMPP community that schemas do not restrict the existence of things they don’t describe. They only impose restrictions on things they describe. I share that opinion.
Hm, I recall, there was a similar discussion here:
Seems to bug while parsing presense stanzas - Smack 4.1.0-rc4
The value “online” is not described, so it may exist?
In both cases I think the “online” show-value and the text element should be ignored by clients, due to:
Clients are advised not to rely on the ability to send data that does not conform to the schemas, and SHOULD ignore any non-conformant elements or attributes on the incoming XML stream.
and XEP-0198 should get clear about the usage of the text element.
One more thing related to this is i am getting ‘No response received within reply timeout’ for login request. After reply timeout(20 second in my case), getting the ‘text’ parsing error. I think, it should immediately return exception related to stream resumption after getting ‘previous session timeout’ error from server.