AnsweredAssumed Answered

Smack 4.2 alpha1 - Disconnecting from server after a minute (SmackException: Parser got END_DOCUMENT event)

Question asked by Alexey on Mar 7, 2015
Latest reply on Nov 14, 2016 by kevin

The problem is that after a minute of connection exception you can see below occurs.

 

SENT (0): <stream:stream xmlns='jabber:client' to='domain.com' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='userName@domain.com@domain.com' xml:lang='en'>

 

RECV (0): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="domain.com" id="487d8246" xml:lang="en" version="1.0">

RECV (0): <stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mech anism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mech anism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>

 

D/ZAQ-ChatConnection﹕ connected

 

SENT (0): <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'>=</auth>

RECV (0): <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmV...XNz</challenge>

SENT (0): <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>dXN...i04</response>

RECV (0): <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnN...mNw==</success>

SENT (0): <stream:stream xmlns='jabber:client' to='domain.com' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='userName@domain.com@domain.com' id='487d8246' xml:lang='en'>

RECV (0): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="domain.com" id="487d8246" xml:lang="en" version="1.0"><stream:features><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></stream:features>

SENT (0): <iq id='xf4lU-1' type='set'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>Smack</resource></bind></iq>

RECV (0): <iq type="result" id="xf4lU-1" to="domain.com/487d8246"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>userName@domain.com/Smack</jid></bind></iq>

SENT (0): <iq id='xf4lU-3' type='set'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>

RECV (0): <iq type="result" id="xf4lU-3" to="userName@domain.com/Smack"/>

User logged (0): userName@domain.com:5223/Smack

 

D/ZAQ-ChatConnection﹕ authenticated

 

XMPPConnection authenticated (0)

SENT (0): <iq id='xf4lU-5' type='get'><query xmlns='jabber:iq:roster'></query></iq>

<presence id='xf4lU-6'></presence>

RECV (0): <iq type="result" id="xf4lU-5" to="userName@domain.com/Smack"><query xmlns="jabber:iq:roster"/></iq>

03-08 07:33:05.428 RECV (0): <presence id="xf4lU-6" from="userName@domain.com/Smack" to="userName@domain.com/Smack"/>

 

03-08 07:34:05.318    2807-3267/com.myapp.name W/AbstractXMPPConnection﹕ Connection closed with error

    org.jivesoftware.smack.SmackException: Parser got END_DOCUMENT event. This could happen e.g. if the server closed the connection without sending a closing stream element

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1126)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:915)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:930)

            at java.lang.Thread.run(Thread.java:841)


D/ZAQ-ChatConnection﹕ connectionClosedOnErrororg.jivesoftware.smack.SmackException: Parser got END_DOCUMENT event. This could happen e.g. if the server closed the connection without sending a closing stream element

Outcomes