Javax Websocket closing due to Illegal UTF-8 Sequence
问题 I'm writing a Websocket client in Java, using javax.websocket API, and org.glassfish.tyrus as the implementation. Everything usually works, but sometimes, when I'm receiving very large strings, the connection closes with a mysterious 'Illegal UTF-8 Sequence' as the close reason. log.info("Ws closed cuz: " + reason.getCloseCode() + " , " + reason.getReasonPhrase() + " , " + reason.toString()); Output: INFO: Ws closed cuz: NOT_CONSISTENT , Illegal UTF-8 Sequence , CloseReason[1007,Illegal UTF-8