首页 > 编程语言 > 详细

SpringBoot整合webSocket出现Are you running in a Servlet container that supports JSR-356?

时间:2020-08-12 15:04:04      阅读:390      评论:0      收藏:0      [点我收藏+]

如果你使用的是SpringBoot自带的tomcat出现这种问题 那么换成别的容器就行了。

首先要将已经存在的容器排除掉 使用 exclusions 排除容器依赖 然后再添加别的容器依赖

比如

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

如果你使用的恰好是undertow这个容器 那么换成tomcat容器试试

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

我自己整合的时候没有出现过这种问题,但是使用开源框架的时候出现了这种问题,

经过排查发现作者使用的是undertow容器。

参考文章:

https://blog.csdn.net/nuoyuezuo/article/details/105664474

https://www.cnblogs.com/ZMargo/articles/13364594.html

SpringBoot整合webSocket出现Are you running in a Servlet container that supports JSR-356?

原文:https://www.cnblogs.com/yang-xiansen/p/13490269.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!