1. org.apache.mina.filter.codec.ProtocolDecoderException: java.nio.BufferOverflowException not receive data error
One reason:
Buffer too small
modify:
connection.getSessionConfig().setReadBufferSize(1024*1024);//发送缓冲区1M
connection.getSessionConfig().setReceiveBufferSize(1024*1024);//接收缓冲区1M
If the error remains after modification:
Check the filter:
chain.addLast("a", new LoggingFilter());
chain.addLast("b", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
Filter client and server try to keep up, and can only have one filter.