title: Javax Websocket closing due to Illegal UTF-8 Sequence
body: <p>I'm writing a Websocket client in Java, using javax.websocket API, and <code>org.glassfish.tyrus</code> as the implementation.</p>
  
  <p>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.</p>
  
  <pre><code>log.info("Ws closed cuz: " 
     + reason.getCloseCode() + " , " 
     + reason.getReasonPhrase() + " , " 
     + reason.toString());
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>INFO: Ws closed cuz: NOT_CONSISTENT , Illegal UTF-8 Sequence ,
  CloseReason[1007,Illegal UTF-8 Sequence]
  </code></pre>
  
  <p>I'm guessing that either the string was too large, or the string contained any characters which aren't UTF-8 compatible.</p>
  
  <p>Is there a way to get any more info on the actual string / packet / frame which causes this issue? Or, if there's a way to tell tyrus to ignore any encoding issues and just pass me the raw string and let me handle it?</p>
  
  <p>If not, is there another java websockets client which does the bare bones work of transmitting the strings over socket and doesn't do any validation, and just lets me handle the responses?</p>
  
  <p>Appreciate any feedback.</p>