Skip to content

Stomp error when PongMessage is passed to StompSubProtocolHandler [SPR-12728] #17325

@spring-projects-issues

Description

@spring-projects-issues

Mark Anderson opened SPR-12728 and commented

StompSubProtocolHandler cannot handle receiving a PongMessage.

ERROR Feb 18 11:15:47 (56612 [qtp300104620-57] org.springframework.web.socket.messaging.StompSubProtocolHandler) Failed to parse PongMessage payload=[java.nio.HeapByteBuffer[pos=0 lim=0 cap=0]], byteCount=0, last=true] in session 123f6cb6. Sending STOMP ERROR to client.
     [java] java.lang.IllegalArgumentException: Unexpected WebSocket message type: PongMessage payload=[java.nio.HeapByteBuffer[pos=0 lim=0 cap=0]], byteCount=0, last=true]
     [java] 	at org.springframework.web.socket.messaging.StompSubProtocolHandler.handleMessageFromClient(StompSubProtocolHandler.java:203)
     [java] 	at org.springframework.web.socket.messaging.SubProtocolWebSocketHandler.handleMessage(SubProtocolWebSocketHandler.java:309)
     [java] 	at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75)
     [java] 	at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75)
     [java] 	at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75)
     [java] 	at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56)
     [java] 	at org.springframework.web.socket.handler.ExceptionWebSocketHandlerDecorator.handleMessage(ExceptionWebSocketHandlerDecorator.java:72)
     [java] 	at com.psymetrix.pdc.web.CustomJettyWebSocketHandlerAdapter.onWebSocketFrame(CustomJettyWebSocketHandlerAdapter.java:55)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:483)
     [java] 	at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:71)
     [java] 	at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:72)
     [java] 	at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onFrame(JettyAnnotatedEventDriver.java:149)
     [java] 	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:107)
     [java] 	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:309)
     [java] 	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214)
     [java] 	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220)
     [java] 	at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258)
     [java] 	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:613)
     [java] 	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:468)
     [java] 	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
     [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:626)
     [java] 	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:546)
     [java] 	at java.lang.Thread.run(Thread.java:745)

Note that the CustomJettyWebSocketHandlerAdapter class in the stack trace is used to workaround #17324


Affects: 4.1.4

Issue Links:

Referenced from: commits 917eb1d, 6fafe63

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions