javax.websocket.server.ServerContainer not available 报错

  • 作者: 凯哥Java(公众号:凯哥Java)
  • 经验分享
  • 时间:2023-02-26 12:34
  • 2195人已阅读
简介 因为这个错误我花费了一下午的时间,就是为了在springboot中集成websocket太难的网上大多数的回答都是测试时报错,我是启动时报错,废话不说了,直接进入主题环境情况springboot:2.2.13acitiviti6websocket2.报错信息从报错信息中无法获取到什么有用的信息,我就知道这个ServerEndpointExporter是有问题的其他的我也不知道解决方法:修改mave

🔔🔔好消息!好消息!🔔🔔

 如果您需要注册ChatGPT,想要升级ChatGPT4。凯哥可以代注册ChatGPT账号代升级ChatGPT4

有需要的朋友👉:微信号 kaigejava2022

因为这个错误我花费了一下午的时间,就是为了在 springboot 中集成websocket 太难的 网上大多数的回答都是测试时报错,我是启动时报错,废话不说了,直接进入主题

  1. 环境情况
    springboot:2.2.13
    acitiviti6
    websocket
    2.报错信息

  2. 6b394b1850a0057f50763899f9daec55.png

  3. 从报错信息中 无法获取到什么有用的信息,我就知道这个 ServerEndpointExporter 是有问题的 其他的我也不知道

  4. 解决方法:
    修改maven SpringBoot Web 将tomcat 去除掉

  5. f1498a398f48f22c9e585d80f6b207e1.png

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


自此启动成功 真狗血
网上解决此问题的思路
1.因为是springbootTest的问题 需要增加注释 自己百度把
2.包冲突导致的(本文也算是)
3.说是tomcat 和web容器之间的问题 (本文也算是吧)
问题解决 开心

TopTop