error=
/org.apache.mina.filter.codec.ProtocolDecoderException: java.nio.charset.MalformedInputException: Input length = 1 (Hexdump: AC … 94)
// at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:170)
// 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:662)
//Caused by: java.nio.charset.MalformedInputException: Input length = 1
// 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:183)
// at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:45)
// at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)
// at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:163)
// … 9 more
error source=org.jivesoftware.openfire.nio.XMPPDecoder
3.7 original code
// Parse as many stanzas as possible from the received data
parser.read(in);
patched code
// Parse as many stanzas as possible from the received data
int pos=in.position();//Returns this buffer’s position
try {
parser.read(in);
} catch (java.nio.charset.MalformedInputException e) {
in.position(pos);//Sets this buffer’s position.
return false;// Return false if remaining data is not enough to decode, then this method will be invoked again when more data is cumulated.
}