DEBUG o.s.web.servlet.DispatcherServlet - Could not complete request
org.springframework.web.socket.server.HandshakeFailureException: Uncaught failure for request http://localhost:8080/mvc-web/myHandler; nested exception is java.lang.NoSuchMethodError: org.springframework.web.util.WebUtils.isSameOrigin(Lorg/springframework/http/HttpRequest;)Z
at org.springframework.web.socket.server.support.WebSocketHttpRequestHandler.handleRequest(WebSocketHttpRequestHandler.java:174) ~[spring-websocket-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51) ~[spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) ~[spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) [spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) [spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [servlet-api.jar:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) [spring-webmvc-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java
spring websocket 职业踩坑队
在尝试将SPRING MVC与WEBSOCKET集成时,遇到特定错误,尝试多种解决办法未果。发现该问题可能与使用4.2.4.RELEASE版本的WEBSOCKET包有关。官方示例中使用的是4.0.1.RELEASE版本,降级版本后问题解决。4.2.4版本可能需要采用Interceptor的实现方式。
摘要由CSDN通过智能技术生成