1 Reply Latest reply on Jun 6, 2017 12:22 AM by Flow

    Smack 4.2.1-SNAPSHOT unable to handle embedded </text> element sent from server when session resume failed

    cmeng

      Below is a capture of the log while testing aTalk in session resume. The ejabberd xmpp server responses with the following stanza with an embedded descriptive </text> element giving the reason for the resume failure.

       

      06-06 08:05:58.252 D/SMACK: RECV (1): <failed h='20' xmlns='urn:xmpp:sm:3'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Previous session timed out</text></failed>

       

      However smack attempt to decode this <.text> to XMPPErrorCondition but failed with

      "java.lang.IllegalStateException: Could not transform string 'text' to XMPPErrorCondition"

       

      Note: XEP-0198: "Stream Management#Example 12. Stream timed" out does not specifically state a requirement for an descriptive </text> elements. Not sure if ejabberd or Smack need action on this error.

       

      =========== atalk Log failed on resume due to "Previous session timed out" ================

      06-06 08:05:58.092 D/SMACK: SENT (1): <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>biwsbj10ZXN0LHI9PF4wRF49ciMhKDkoXzt5QyZpd0J2fnx+QXc2RG9 ATGQ=</auth>

      06-06 08:05:58.102 D/SMACK: RECV (1): <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj08XjBEXj1yIyEoOShfO3lDJml3QnZ+fH5Bdz ZEb0BMZDEyTE9VK0JBckhYUG1iWWFHRmROTWc9PSxzPUFlVHVURmQxMlV6anN4SjZkNy80RlE9PSxpPT QwOTY=</challenge>

      06-06 08:05:58.112 D/SMACK: SENT (1): <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>Yz1iaXdzLHI9PF4wRF49ciMhKDkoXzt5QyZpd0 J2fnx+QXc2RG9ATGQxMkxPVStCQXJIWFBtYllhR0ZkTk1nPT0scD1ldUxsaUQyU3hyQ2VBUENKd29sUk FZSUdUNHc9</response>

      06-06 08:05:58.142 D/SMACK: RECV (1): <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>dj1RTndiRGJlRTRWajRKUit0Sk1XbHJJVGhRK1 U9</success>

      06-06 08:05:58.142 D/SMACK: SENT (1): <stream:stream xmlns='jabber:client' to='atalk.org' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' id='2896674283834107045' xml:lang='en'><resume xmlns='urn:xmpp:sm:3' h='17' previd='g2gCbQAAAAVhdGFsa2gDYgAABdhiAArIbGEg'/>

      06-06 08:05:58.252 D/SMACK: RECV (1): <?xml version='1.0'?><stream:stream id='8777163671007096347' version='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' from='atalk.org' xmlns='jabber:client'>

      06-06 08:05:58.252 D/SMACK: RECV (1): <stream:features><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'><optional/></session><c ver='cJUVXXV+5khBwVJS8OXzJd4l35c=' node='http://www.process-one.net/en/ejabberd/' hash='sha-1' xmlns='http://jabber.org/protocol/caps'/><sm xmlns='urn:xmpp:sm:2'/><sm xmlns='urn:xmpp:sm:3'/><ver xmlns='urn:xmpp:features:rosterver'/><csi xmlns='urn:xmpp:csi:0'/></stream:features>

      06-06 08:05:58.252 D/SMACK: RECV (1): <failed h='20' xmlns='urn:xmpp:sm:3'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Previous session timed out</text></failed>

      06-06 08:06:03.152 W/αTalk: [48] org.jivesoftware.smack.AbstractXMPPConnection.callConnectionClosedOnErrorListen er() Connection XMPPTCPConnection[test@atalk.org/atalk] (1) 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)

                                   Caused by: java.lang.IllegalArgumentException: text is not a constant in org.jivesoftware.smack.packet.XMPPError$Condition

                                      at java.lang.Enum.valueOf(Enum.java:200)

                                      at org.jivesoftware.smack.packet.XMPPError$Condition.valueOf(XMPPError.java:374)

                                      at org.jivesoftware.smack.packet.XMPPError$Condition.fromString(XMPPError.java:412 )

                                      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)