org.apache.tomcat.websocket.WsWebSocketContainer无法转换为io.undertow.websockets.jsr.ServerWebSocketContainer [英] org.apache.tomcat.websocket.WsWebSocketContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer

查看:956
本文介绍了org.apache.tomcat.websocket.WsWebSocketContainer无法转换为io.undertow.websockets.jsr.ServerWebSocketContainer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个spring mvc项目.有时在启动SpringBoot应用程序时出现以下错误.

I am developing a spring mvc project. Sometimes while starting my SpringBoot application I am getting following error.

org.springframework.context.ApplicationContextException:无法启动嵌入式容器.嵌套的异常是 java.lang.ClassCastException:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.ClassCastException:

详细日志如下:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.ClassCastException: org.apache.tomcat.websocket.WsWebSocketContainer cannot be cast to io.undertow.websockets.jsr.ServerWebSocketContainer
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)

推荐答案

在pom.xml中删除它:)

Remove this in your pom.xml :)

   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-undertow</artifactId>
    </dependency>

这篇关于org.apache.tomcat.websocket.WsWebSocketContainer无法转换为io.undertow.websockets.jsr.ServerWebSocketContainer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆