servercontainer专题

SpringBoot引入WebSocket依赖报ServerContainer no avaliable

1、WebSocketConfig 文件报错 @Configuration@EnableWebSocketpublic class WebSocketConfig {@Beanpublic ServerEndpointExporter serverEndpointExporter() {return new ServerEndpointExporter();} 2、报错内容 Exce

springboot整合websocket后启动报错:javax.websocket.server.ServerContainer not available

一、场景 Springboot使用@ServerEndpoint来建立websocket链接。引入依赖。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> 配置Websocket

springboot打包报错javax.websocket.server.ServerContainer not available的解决办法

在单元测试类中修改@SpringBootTest的内容如下: @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)