Description
If one extends the CumulativeDecoder and finds that there is not enough data in the buffer, one returns false on doDecode() so mina can collect more data. However, it seems that CumulativeDecoder puts the last remaining bytes from the decode into an UnderivableBuffer and stores it in the session. When it gets more data later, the data is added to this session buffer, and the CumulativeDecoder subclass gets to it.
Calling methods like slice() and duplicate() on an UnderivableBuffer throw an exception. Therefore, your cumulative decoder that does slice() will result in an exception.
See http://www.nabble.com/CumulativeDecoder-using-UnderivableBuffer-to15969933.html for more discussion.
I've just fixed this issue by modifying CumulativeProtocolDecoder to reallocate its internal buffer when buffer derivation is detected. Please confirm the fix and close this issue.