here is my WebSocketConfig
here is the test WebSocketConfigTest
it's working in 4.0.0-M3, but not RC1, not sure how to fix, here is the error
2025-10-27T21:19:47.394+08:00 ERROR 14900 --- [cTaskExecutor-1] [ ] o.s.w.s.s.client.XhrClientSockJsSession : WebSocketHandler.afterConnectionEstablished threw exception in XhrClientSockJsSession[id='e4ce3e10faa84a028e5d65ab7c532b5b, url=http://localhost:9999/websocket/connect]
org.springframework.messaging.MessageDeliveryException: null
at org.springframework.messaging.simp.stomp.DefaultStompSession.execute(DefaultStompSession.java:287) ~[spring-messaging-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.messaging.simp.stomp.DefaultStompSession.afterConnected(DefaultStompSession.java:403) ~[spring-messaging-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.afterConnectionEstablished(WebSocketStompClient.java:353) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.handler.WebSocketHandlerDecorator.afterConnectionEstablished(WebSocketHandlerDecorator.java:70) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.afterConnectionEstablished(LoggingWebSocketHandlerDecorator.java:48) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession.handleOpenFrame(AbstractClientSockJsSession.java:240) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession.handleFrame(AbstractClientSockJsSession.java:222) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.RestTemplateXhrTransport$XhrReceiveExtractor.handleFrame(RestTemplateXhrTransport.java:258) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.RestTemplateXhrTransport$XhrReceiveExtractor.extractData(RestTemplateXhrTransport.java:242) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:757) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:715) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.RestTemplateXhrTransport.lambda$connectInternal$0(RestTemplateXhrTransport.java:119) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
Caused by: org.springframework.web.client.HttpClientErrorException$NotFound: 404 on POST request for "http://localhost:9999/websocket/connect/230/e4ce3e10faa84a028e5d65ab7c532b5b/xhr_send": [no body]
at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:115) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:145) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:120) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:807) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:756) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:715) ~[spring-web-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.RestTemplateXhrTransport.executeSendRequestInternal(RestTemplateXhrTransport.java:145) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
at org.springframework.web.socket.sockjs.client.AbstractXhrTransport.executeSendRequest(AbstractXhrTransport.java:151) ~[spring-websocket-7.0.0-RC2.jar:7.0.0-RC2]
kindly suggest
Thank you
Comment From: wilkinsona
Thanks for trying out the RC. Unfortunately, the supplied sample is too complex for us to investigate. Specifically, it contains many dependency, classes and tests that are unrelated to WebSocket. Please reduce it down to something that contains the bare minimum that's required for the failure to occur and we can take another look.
Comment From: mjd507
Thank you, here is the minimum project that can reproduce the issue.
https://github.com/mjd507/websocket-test
Comment From: snicoll
Thanks. I can indeed reproduce with RC1 and it works with M3. However, if I downgrade Spring Security from 7.0.0-RC1 to 7.0.0-M3 this works with Spring Boot RC1 as well. You can validate that by adding the following to the build of your sample:
extra["spring-security.version"] = "7.0.0-M3"
I cannot transfer this issue to Spring Security unfortunately. Please submit it with a link to this issue at https://github.com/spring-projects/spring-security/issues/new