https://bz.apache.org/bugzilla/show_bug.cgi?id=57831
Bug ID: 57831
Summary: Fragmented JSON Messages Causing IllegalStateException
Product: Tomcat 8
Version: 8.0.21
Hardware: All
OS: All
Status: NEW
Severity: critical
Priority: P2
Component: WebSocket
Assignee: [email protected]
Reporter: [email protected]
Created attachment 32660
--> https://bz.apache.org/bugzilla/attachment.cgi?id=32660&action=edit
Message that causes the failure
Tomcat 8.0.21 (not 8.0.20 or earlier) is throwing an IllegalStateException for
JSON messages. Below is the exception being thrown.
Exception in thread "WebSocketServer-localhost-/temp-4"
java.lang.IllegalStateException: When sending a fragmented message, all
fragments bust be of the same type
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:411)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.endMessage(WsRemoteEndpointImplBase.java:366)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase$IntermediateMessageHandler.onResult(WsRemoteEndpointImplBase.java:513)
at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer$OnResultRunnable.run(WsRemoteEndpointImplServer.java:247)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Attached is the message that is causing the issue.
Looking at the top few lines:
{
"context": "4IVS04",
"data": {
"enterfornext": true,
"inputs": [
{
"autocomplete": 3,
"desc": "Enter Tool: ",
"options": [
"DNOTCH10",
"DNOTCH11",
If the entire "DNOTCH10" line is removed, the message can be transmitted by
Tomcat; however, even adding a single "illegal" character in the JSON after
this line is removed causes the error to be thrown.
It appears Tomcat is analyzing the fragments its sending and determining that
some cannot be sent because they are not legitimate JSON (or something to that
affect).
Again, version 8.0.20 and below does not have this issue.
Thanks
Ken
P.S. I can provide the test web app to demonstrate this.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]