ARTICLE AD BOX
I'm building an app that exposes REST endpoints implemented using spring-boot-starter-webflux; and websocket endpoints implemented using spring-boot-starter-websocket.
I'm seeing the attached runtime exception when combining spring-boot-starter-webflux and spring-boot-starter-websocket dependencies. It occurs when a request comes to my reactive REST endpoint with the following signature:
@PostMapping public Mono<ResponseEntity<String>> outbound(ServerHttpRequest request) { ... }Happens in both Spring Boot 3 (I tried version 3.5.10) and 4 (I tried version 4.0.2)
I encounter NO such exception if:
I remove the spring-boot-starter-websocket dependency or I replace it with spring-messagingQuestion: Are spring-boot-starter-webflux and spring-boot-starter-websocket simply incompatible, or am I missing some configuration?
Full exception:
2026-02-03 17:15:34.824 [http-nio-8080-exec-2] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.IllegalStateException: No primary or single unique constructor found for interface org.springframework.http.server.reactive.ServerHttpRequest] with root cause java.lang.IllegalStateException: No primary or single unique constructor found for interface org.springframework.http.server.reactive.ServerHttpRequest at org.springframework.beans.BeanUtils.getResolvableConstructor(BeanUtils.java:265) at org.springframework.validation.DataBinder.createObject(DataBinder.java:904) at org.springframework.validation.DataBinder.construct(DataBinder.java:884) at org.springframework.web.bind.ServletRequestDataBinder.construct(ServletRequestDataBinder.java:116) at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.constructAttribute(ServletModelAttributeMethodProcessor.java:154) at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:147) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:122) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:230) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:180) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:934) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:853) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:86) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:866) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1003) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:903)531 silver badge7 bronze badges
1
Explore related questions
See similar questions with these tags.
