Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

XMPP connection closed "java.lang.IllegalStateException: Parser should never return 'null' on getText() here"

$
0
0

Hi Smack Devs,

 

I'm developing an Android messaging application that is connected to a server running ejabberd.

 

My Android app is running aSmack 4.0.0, so far aSmack is helping a lot in my project, the mobile app is able to connect, authenticate, extent for custom features and send/receive packages as expected but, I've a weird problem in some scenarios that is causing an unexpected connection shutdown. I've researched about the exception but there is no information about it, so hope that someone can help me to find the problem.

 

Basically what it is happening is that after sent some kind of packets the smack client is trying to send this packet "</stream:stream>" causing an IllegalStateException and start the reconnection process. Please take a look into the following logs:

 

D/SMACK   (11370): SENT (0): </stream:stream>

W/XMPPConnection(11370): Connection closed with error

W/XMPPConnection(11370): java.lang.IllegalStateException: Parser should never return 'null' on getText() here

W/XMPPConnection(11370):           at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepth(PacketParserUti ls.java:161)

W/XMPPConnection(11370):           at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:174)

W/XMPPConnection(11370):           at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:48)

W/XMPPConnection(11370):           at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:82)

D/SMACK   (11370): Connection closed due to an exception (0)

D/dalvikvm( 2213): GC_CONCURRENT freed 379K, 4% free 17966K/18548K, paused 1ms+2ms, total 19ms

D/MyApp    (11370): MyAppMessagingService: Reconnecting to XMPP in, 5, seconds,

D/SMACK   (11370): Connection (0) will reconnect in 5

D/MyApp    (11370): MyAppMessagingService: Reconnecting to XMPP in, 4, seconds,

D/SMACK   (11370): Connection (0) will reconnect in 4

D/MyApp    (11370): MyAppMessagingService: Reconnecting to XMPP in, 3, seconds,

D/SMACK   (11370): Connection (0) will reconnect in 3

D/MyApp    (11370): MyAppMessagingService: Reconnecting to XMPP in, 2, seconds,

D/SMACK   (11370): Connection (0) will reconnect in 2

D/MyApp    (11370): MyAppMessagingService: Reconnecting to XMPP in, 1, seconds,

D/SMACK   (11370): Connection (0) will reconnect in 1

D/MyApp    (11370): MyAppMessagingService: Reconnecting to XMPP in, 0, seconds,

D/SMACK   (11370): Connection (0) will reconnect in 0

 

I'm aware of two scenarios where this is happening 1) After request time using EntityTimeManager 2) After send a message to any chat

 

As extra information, I'm using the PingManager to keep connection alive and that works ok until I try to send one of the packets mentioned previously.

 

Please help and thanks in advance!


Viewing all articles
Browse latest Browse all 10742

Trending Articles