Nullpointer on Wifi to Mobile data switch multiple times

11-15 22:07:50.804 24975-25599/com.griffin W/AbstractXMPPConnection﹕ Connection closed with error

java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)

at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)

at libcore.io.IoBridge.recvfrom(IoBridge.java:509)

at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)

at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)

at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)

at java.io.InputStreamReader.read(InputStreamReader.java:244)

at java.io.BufferedReader.read(BufferedReader.java:310)

at org.jivesoftware.smack.util.ObservableReader.read(ObservableReader.java:41)

at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1496)

at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:979)

at org.kxml2.io.KXmlParser.next(KXmlParser.java:346)

at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)

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

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

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

11-15 22:07:50.809 24975-25599/com.griffin D/SMACK﹕ Connection closed due to an exception (0)

11-15 22:07:50.814 24975-25599/com.griffin D/ConnectionsManager﹕ XMPPClosedOnError

11-15 22:07:50.829 24975-25599/com.griffin E/ConnectionsManager﹕ in try re-connect

11-15 22:07:51.189 24975-26198/com.griffin D/SMACK﹕ SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘ec2-75-101-132-5.compute-1.amazonaws.com’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’>

11-15 22:07:51.394 24975-26199/com.griffin D/SMACK﹕ RCV (0): <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ id=‘410609671’ from=‘ec2-75-101-132-5.compute-1.amazonaws.com’ version=‘1.0’ xml:lang=‘en’>stream:featuresPLAIN</mechanis ms><register xmlns='http://jabber.org/features/iq-register’/></stream:features>

11-15 22:07:51.399 24975-24996/com.griffin D/ConnectionsManager﹕ Connected to datacenter

11-15 22:07:51.409 24975-26198/com.griffin D/SMACK﹕ SENT (0): AEFGMkRFNDdFRjBGNDcwRjNFRjQzRjE5NgA5MjUzNUVBQTdDMzU1REVEMzJEM Dk0

11-15 22:07:51.949 24975-26199/com.griffin D/SMACK﹕ RCV (0):

11-15 22:07:51.954 24975-26198/com.griffin D/SMACK﹕ SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘ec2-75-101-132-5.compute-1.amazonaws.com’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’>

11-15 22:07:51.954 24975-26198/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:52.164 24975-26199/com.griffin D/SMACK﹕ RCV (0): <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ id=‘410609671’ from=‘ec2-75-101-132-5.compute-1.amazonaws.com’ version=‘1.0’ xml:lang=‘en’>stream:features<register xmlns='http://jabber.org/features/iq-register’/></stream:features>

11-15 22:07:52.169 24975-24996/com.griffin D/SMACK﹕ User logged (0): 919764224003@ec2-75-101-132-5.compute-1.amazonaws.com/8D665A03@ec2-75-101-132-5.compute-1.amazonaws.com:5222

11-15 22:07:52.169 24975-24996/com.griffin D/ConnectionsManager﹕ XMPPAuthenticated

11-15 22:07:52.169 24975-26198/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:52.169 24975-26198/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:52.169 24975-24996/com.griffin D/GriffinAccounts﹕ Authenticated user: 919764224003

11-15 22:07:52.174 24975-26198/com.griffin D/SMACK﹕ SENT (0): Online

11-15 22:07:52.179 24975-26198/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:52.179 24975-26198/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:52.399 24975-26199/com.griffin D/SMACK﹕ RCV (0):

11-15 22:07:52.409 24975-26198/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:52.719 24975-26199/com.griffin D/SMACK﹕ RCV (0): Online

11-15 22:07:52.754 24975-26199/com.griffin W/AbstractXMPPConnection﹕ Connection closed with error

** java.lang.NullPointerException**

** at org.jivesoftware.smack.tcp.XMPPTCPConnection.processHandledCount(XMPPTCPConnect ion.java:1680)**

at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$2400(XMPPTCPConnection.java :133)

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

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

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

11-15 22:07:52.759 24975-26199/com.griffin D/SMACK﹕ Connection closed due to an exception (0)

11-15 22:07:52.759 24975-26199/com.griffin D/ConnectionsManager﹕ XMPPClosedOnError

11-15 22:07:52.759 24975-26199/com.griffin E/ConnectionsManager﹕ in try re-connect

11-15 22:07:53.029 24975-26263/com.griffin D/SMACK﹕ SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘ec2-75-101-132-5.compute-1.amazonaws.com’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’>

11-15 22:07:53.334 24975-26264/com.griffin D/SMACK﹕ RCV (0): <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ id=‘2701249877’ from=‘ec2-75-101-132-5.compute-1.amazonaws.com’ version=‘1.0’ xml:lang=‘en’>stream:featuresPLAIN</mechanis ms><register xmlns='http://jabber.org/features/iq-register’/></stream:features>

11-15 22:07:53.339 24975-24996/com.griffin D/ConnectionsManager﹕ Connected to datacenter

11-15 22:07:53.349 24975-26263/com.griffin D/SMACK﹕ SENT (0): AEM1QjdGODIyN0FDQkU4QUZGMzg0REYxQQBFNjY1MkZFMzUzQkQ0M0EyRkMwR EEz

11-15 22:07:53.884 24975-26264/com.griffin D/SMACK﹕ RCV (0):

11-15 22:07:53.884 24975-26263/com.griffin D/SMACK﹕ SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘ec2-75-101-132-5.compute-1.amazonaws.com’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’>

11-15 22:07:53.889 24975-26263/com.griffin D/SMACK﹕ SENT (0):

11-15 22:07:54.094 24975-26264/com.griffin D/SMACK﹕ RCV (0): <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ id=‘2701249877’ from=‘ec2-75-101-132-5.compute-1.amazonaws.com’ version=‘1.0’ xml:lang=‘en’>

11-15 22:07:54.099 24975-26264/com.griffin D/SMACK﹕ RCV (0): stream:features<register xmlns='http://jabber.org/features/iq-register’/></stream:features>

11-15 22:07:54.104 24975-26264/com.griffin D/SMACK﹕ RCV (0):

11-15 22:07:55.514 24975-24975/com.griffin E/ConnectionsManager﹕ in try re-connect

11-15 22:07:56.234 24975-24975/com.griffin E/ConnectionsManager﹕ in try re-connect

11-15 22:07:56.659 24975-24975/com.griffin E/ConnectionsManager﹕ in try re-connect

11-15 22:08:03.889 24975-24996/com.griffin W/System.err﹕ org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 10000ms (~10s)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at org.jivesoftware.smack.SynchronizationPoint.checkForResponse(SynchronizationPoi nt.java:176)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at org.jivesoftware.smack.SynchronizationPoint.sendAndWaitForResponse(Synchronizat ionPoint.java:75)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection.loginNonAnonymously(XMPPTCPConnect ion.java:366)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java :369)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at com.griffin.messenger.GriffinAccounts.gLogin(GriffinAccounts.java:88)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at com.griffin.messenger.ConnectionsManager$6.run(ConnectionsManager.java:257)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:730)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:92)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at android.os.Looper.loop(Looper.java:176)

11-15 22:08:03.894 24975-24996/com.griffin W/System.err﹕ at com.griffin.utilities.DispatchQueue.run(DispatchQueue.java:97)

11-15 22:08:03.924 24975-24996/com.griffin E/AndroidRuntime﹕ FATAL EXCEPTION: networkQueue

** java.lang.NullPointerException**

** at org.jivesoftware.smack.SASLAuthentication.serverMechanisms(SASLAuthentication.j ava:411)**

** at org.jivesoftware.smack.SASLAuthentication.hasNonAnonymousAuthentication(SASLAut hentication.java:163)**

** at org.jivesoftware.smack.tcp.XMPPTCPConnection.loginNonAnonymously(XMPPTCPConnect ion.java:347)**

** at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java :369)**

at com.griffin.messenger.GriffinAccounts.gLogin(GriffinAccounts.java:88)

at com.griffin.messenger.ConnectionsManager$6.run(ConnectionsManager.java:257)

at android.os.Handler.handleCallback(Handler.java:730)

at android.os.Handler.dispatchMessage(Handler.java:92)

at android.os.Looper.loop(Looper.java:176)

at com.griffin.utilities.DispatchQueue.run(DispatchQueue.java:97)

11-15 22:08:04.349 24975-26264/com.griffin W/AbstractXMPPConnection﹕ Connection closed with error

** java.lang.NullPointerException**

** at org.jivesoftware.smack.tcp.XMPPTCPConnection.processHandledCount(XMPPTCPConnect ion.java:1680)**

** at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$2400(XMPPTCPConnection.java :133)**

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

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

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

11-15 22:08:04.354 24975-26264/com.griffin D/SMACK﹕ Connection closed due to an exception (0)

This is with which git revision of Smack? You can get the git revision with SmackConfiguration.getVersion()

Alpha-6 snapshot.

Also i guess this happens on relogin it does not throw already logged in exception.

That’s only the Smack version, but since snapshots versions are not stable I need to know the git revision.

Maybe some background: A stacktrace is always helpful information, and the NullPointerException tells us that some reference that was tried to dereference was null. But without knowing the git revision, I can’t tell which reference this was.

But if you have the corresponding source, you could also show us the line of code where the NPE is thrown.