spring Websocket 报 No suitab le default RequestUpgradeStrategy found

摘要:
开始使用Tomcat8开发一切挺好的,但是公司的Paas平台上的服务器是Resin4.0.44,启动时包如下错误WARNo.s.web.context.support.XmlWebApplicationContext-Exceptionencounteredduringcontextinitialization-cancellingrefreshattempt:org.springframewor

开始使用Tomcat8开发一切挺好的,但是公司的Paas平台上的服务器是Resin4.0.44,启动时包如下错误

WARN o.s.web.context.support.XmlWebApplicationContext - Exception e

ncountered during context initialization - cancelling refresh attempt: org.springframework.beans.factor
y.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path
resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketConfiguration.class]: Bea
n instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiat
ionException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'w
ebSocketHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No suitab
le default RequestUpgradeStrategy found
2018-02-24 09:33:50.821 [resin-44] ERROR org.springframework.web.servlet.DispatcherServlet - Context in
itialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandle
rMapping' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWe
bSocketConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.spri
ngframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.Ha
ndlerMapping]: Factory method 'webSocketHandlerMapping' threw exception; nested exception is java.lang.
IllegalStateException: No suitable default RequestUpgradeStrategy found、

后来我本地也是用resion,但是一切正常,google后发现添加如下包即可

<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-server</artifactId>
<version>9.2.17.v20160517</version>
</dependency>

免责声明:文章转载自《spring Websocket 报 No suitab le default RequestUpgradeStrategy found》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Flutter实战视频-移动电商-40.路由_Fluro的全局注入和使用方法Linux上MySql远程备份方案下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

全网最通俗易懂理清mybatis中SqlSession、SqlSessionTemplate、SessionFactory和SqlSessionFactoryBean之间的关系

摘自:https://www.cnblogs.com/xiaoming0601/p/12166160.html 我潇洒的灰大狼又回来啦。今天送大家的一句话是: 保持耐心,永远年轻,永远热泪盈眶。 前言 先容我哭一会儿,呜呜呜~昨晚写了一半的文章,还没保存就盖上盖子准备回家,拔下电源准备把电脑塞进书包带回家完成时,懒惰阻止了我,最终还是没带回家,于是,遭报...

SpringBoot启动过程解析(简化)

springBoot web方式启动过程 在这个启动过程中会有各种SpringBoot对外提供的扩展接口来对不同启动阶段进行自定义操作。 了解启动过程也是为了让我们更好理解SpringBoot提供的扩展接口使用   jar包启动或者外置war包启动都是调用SpringApplication.run()方法进行项目启动 tomcat会查询context上下文...

泛型依赖注入出现required a single bean, but 2 were found

问题描述 项目使用了tkmybatis,然后在service层使用泛型抽取了公共的CRUD操作,结果在Controller层注入的时候提示 Field dao in com.gisquest.mmp.server.api.service.impl.BaseServiceImpl required a single bean, but 2 were foun...

普通Java类获取spring 容器的bean的5种方法

本文转载自:http://www.cnblogs.com/duanxz/archive/2014/06/18/3794075.html 方法一:在初始化时保存ApplicationContext对象方法二:通过Spring提供的工具类获取ApplicationContext对象方法三:继承自抽象类ApplicationObjectSupport方法四:继承...

29Spring_Autowriter的一些疑惑(很重要)

我用一个Autowriter去注解一个属性,而且我没有在Spring的配置文件中的bean.xml中注册bean(<bean id=""...);那么这个注解有用吗?答案是不行。也就是说要用Autowriter注解时,其实必须要保证在bean容器中注册过这个bean. bean在bean容器中的注册分为两种: 1.手动:就是在spring.xml配置...

[Java] SpringDemo

IoC/DI 功能 配置解析:将配置文件解析为BeanDefinition结构,便于BeansFactory创建对象 对象创建:BeansFactory根据配置文件通过反射创建对象 对象生命周期管理 组成 ApplicationContext:执行入口 ClassPathXmlApplicationContext:ApplicationContext...