【发布时间】:2020-12-29 14:04:40
【问题描述】:
我在我的应用程序中实现了 websocket。我从 jHipster 生成的应用程序中复制了配置和依赖项,但出现以下错误:
java.lang.IllegalArgumentException: No 'javax.websocket.server.ServerContainer' ServletContext attribute. Are you running in a Servlet container that supports JSR-356?
和
org.apache.catalina.connector.ClientAbortException: java.io.IOException: An established connection was aborted by the software in your host machine
我相信这些错误是套接字连接不一致的原因,因此客户端无法发送和/或接收任何消息。 我搜索了一个解决方案,但其他帖子没有帮助(即添加 glassfish 依赖项)。
这些是我的 ws 依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-messaging</artifactId>
</dependency>
我需要包含一些其他依赖项还是其他地方的问题?
【问题讨论】:
标签: spring spring-boot jhipster spring-websocket