zoukankan      html  css  js  c++  java
  • spring Websocket 报 No suitab le default RequestUpgradeStrategy found

    开始使用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>
  • 相关阅读:
    一分钟制作U盘版BT3
    微软历史最高市值是多少?
    Windows 7系统安装MySQL5.5.21图解
    cocos2d-x3.0 Physics新的物理引擎
    java使用javamail读取邮箱(收件箱为例)
    Java实现第九届蓝桥杯字母阵列
    Java实现第九届蓝桥杯字母阵列
    Java实现第九届蓝桥杯字母阵列
    Java实现第九届蓝桥杯猴子分香蕉
    Java实现第九届蓝桥杯猴子分香蕉
  • 原文地址:https://www.cnblogs.com/b422/p/8486740.html
Copyright © 2011-2022 走看看