powered by Jive Software

NullPointer exception in SASLMechanism

I am using Smack 4.3.4 in Android application to connect to eJabberd server.

The app crashes many times with the following error trace.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method ‘java.lang.String java.lang.CharSequence.toString()’ on a null object reference
at java.text.Normalizer.normalize(Normalizer.java:166)
at org.jivesoftware.smack.sasl.SASLMechanism.saslPrep(SASLMechanism.java:2)
at org.jivesoftware.smack.sasl.core.ScramMechanism.getAuthenticationText(ScramMechanism.java:8)
at org.jivesoftware.smack.sasl.SASLMechanism.authenticate(SASLMechanism.java)
at org.jivesoftware.smack.sasl.SASLMechanism.authenticate(SASLMechanism.java:15)
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:44)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.loginInternal(XMPPTCPConnection.java:21)
at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:40)
at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:40)
at org.jivesoftware.smack.ReconnectionManager$2.run(ReconnectionManager.java:146)
at java.lang.Thread.run(Thread.java:764)

Can you please help in identifying what may be wrong?

Thanks in Advance,

Sunish Kumar

Hi Sunish,
this is hard to debug without further information.

It appears that for some reason authenticationId is null here.
Is it possible that you try to authenticate with a null username?

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.