java.lang.NullPointerException at org.jivesoftware.openfire .net.SASLAuthentication.handle (SASLAuthentication.java:298)

Looking at the log files on the open fire server i found the below exception:

2012.07.10 17:10:52 Closing connection due to error while processing message: dXNlcm5hbWU9IjExNjgwMDEiLHJlYWxtPSJ4bX BwLXFhLm1pdGNoZWxsLmNvbSIsbm9uY2U9InQ1djhTWTBrYndMQnZKcG9XV2tlVlhGeFJzM3Jqd1NjU2 tSNWJlSUMiLGNub25jZT0iMGVjZjRiMGExNGNhYzRhNjM2OTdlZmUwMWI0OGE1ZjhmMjY0MTM2ZTYwM2 RjMTNlZDA3NmU1NzJhMzg1ZTgyNCIsbmM9MDAwMDAwMDEscW9wPWF1dGgsZGlnZXN0LXVyaT0ieG1wcC 94bXBwLXFhLm1pdGNoZWxsLmNvbSIsY2hhcnNldD11dGYtOCxyZXNwb25zZT1lNWMxMGU2ODM3YTBiY2 M4NTk0ODY4NDZiZmEwODgyZg==

java.lang.NullPointerException

at org.jivesoftware.openfire.net.SASLAuthentication.handle(SASLAuthentication.java :298)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:183)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:169)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:185)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Unknown Source)

I looked at the source code (SASLAuthentication.java) where the exception is being thrown and figured out that the value for “SaslMechanism” key in the session is returning a null value. Below is the code snippet:

mechanism = (String) session.getSessionData(“SaslMechanism”);

Above line is from SASLAuthentication.java line no 297 (handle method).

So, I would like to understand what could cause the value to be returned null for the key “SaslMechanism” in the session.

We are using OpenFire Server version 3.7.0

Your help is much appreciated.

Anybody knows what might be causing the above reported issue?

Greetings. I appear to be hitting this now as well with OF 3.8.1 and Xabber android client. Are you still seeing it too?

Here’s the current log message

2013.04.18 14:19:55 org.jivesoftware.openfire.nio.ConnectionHandler - Closing connection due to error while processing message: d…snipped…=

java.lang.NullPointerException

at org.jivesoftware.openfire.net.SASLAuthentication.handle(SASLAuthentication.java :303)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:183)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:181)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:185)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 895)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

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