Description
After setting the max and minReadBufferSize to 256k on the acceptor's session config, the following error is thrown when a client connects:
java.lang.IllegalArgumentException: minReadBufferSize: 262144 (expected: smaller than 65536) at org.apache.mina.core.session.AbstractIoSessionConfig.setMinReadBufferSize(AbstractIoSessionConfig.java:110) at org.apache.mina.core.session.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:60) at org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:65) at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:200) at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:51) ...
These two lines seems to be the problem
AbstractIoSessionConfig.java
setMinReadBufferSize(config.getMinReadBufferSize()); setMaxReadBufferSize(config.getMaxReadBufferSize());
This is due to the fact that there is a check when setting the minReadBuffer (it should be > than maxReadBufferSize) but the max isn't set yet so it compares it with the default value (64k).
Possible fix: just swap the lines, setting the maxReadBufferSize first.