This problem may be caused by org.jivesoftware.openfire.nio.XMLLightweightParser
at line 116 for version 11844
encoder = Charset.forName(charset).newDecoder()
.onMalformedInput(CodingErrorAction.REPORT)
.onUnmappableCharacter(CodingErrorAction.REPORT);
ant for version 11388
encoder = Charset.forName(charset);
this means that cs.newDecoder() .onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE) .decode(bb);
It change from “CodingErrorAction.REPLACE” to “CodingErrorAction.REPORT”
So at line 183 :
encoder.decode(byteBuffer.buf());
It may throw exception for some situations, eg.MalformedInputException and UnmappableCharacterException.
And then it throw to outer and cause disconnect.
Before , “CodingErrorAction.REPLACE”, it don’t throw exception, and it’s OK, But now it’s error.
I modify it to try catch for a encoder.decode(byteBuffer.buf()); , show :
java.nio.charset.MalformedInputException: Input length = 2
at java.nio.charset.CoderResult.throwException(CoderResult.java:260)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:781)
at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:185)
at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:32)
at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:163)
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: 886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)
If I don’t catch it , it will disconnect.