A Spring MVC application with WebSocket support can fail during context initialization, before any WebSocket request reaches the endpoint. In this case Tomcat refused to start the application, and the exception chain pointed from WebSocketHandlerMapping#0 down to DefaultHandshakeHandler#0, ending with a clear message:
[ERROR][localhost-startStop-1] org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:502) Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.socket.server.support.WebSocketHandlerMapping#0': Cannot resolve reference to bean 'org.springframework.web.socket.server.support.WebSocketHttpRequestHandler#0'
while setting bean property 'urlMap' with key [/websocket]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.socket.server.support.WebSocketHttpRequestHandler#0': Cannot resolve reference to bean
'org.springframework.web.socket.server.support.DefaultHandshakeHandler#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.socket.server.support.DefaultHandshakeHandler#0':
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.socket.server.support.DefaultHandshakeHandler]: Constructor threw exception; nested exception is java.lang.IllegalStateException:
No suitable default RequestUpgradeStrategy found
The failure does not mean the /websocket URL mapping is wrong. Spring's WebSocket infrastructure was trying to create a default handshake handler, and that handler could not select a request upgrade strategy for the current servlet container. The key line is No suitable default RequestUpgradeStrategy found: the runtime was not one that Spring's WebSocket support could work with as configured.
The Tomcat version in use was apache-tomcat-7.0.42. Spring's WebSocket server support requires a newer container. Its reference documentation lists WebSocket runtimes such as Tomcat 7.0.47+, Jetty 9.1+, GlassFish 4.1+, WebLogic 12.1.3+, and Undertow 1.0+ (including WildFly 8.0+).
Upgrading Tomcat to apache-tomcat-7.0.82 eliminated the startup error. When this exception appears in a Spring WebSocket setup, checking the servlet container version is a practical first step; changing handler mappings or endpoint configuration will not help if the container itself is below the supported version.