Created attachment 33111 [details] Example of ServerEndpoint implementation. Every time, when I try to transfer empty string through web socket I get an IllegalArgumentException from java.nio.Buffer#limit(int newLimit) because of negative new limit value. The reason of this issue is org.apache.tomcat.websocket.PerMessageDeflate#sendMessagePart(List<MessagePart> uncompressedParts) line: // End of compressed message. Drop EOM bytes and output. compressedPayload.limit(compressedPayload.limit() - EOM_BYTES.length); compressedPayload.limit() has zero value and EOM_BYES.length has value, which greater than 0.
I've been able to reproduce this with some edits to the chat example that ships with Tomcat. Working on a fix now.
Fixed in trunk, 8.0.x (for 8.0.27 onwards) and 7.0.x for 7.0.65 onwards.