websocket - Tomcat 8.5.63 + Primefaces 4.0 + Atmosphere 2.1:响应代码 200 而不是 101
问题描述
将应用程序(Primefaces 4.0 + Atmosphere 2.1)从 Tomcat 7.0.108 迁移到版本 8.5.63 时遇到问题。
在部署在 tomcat 7 中的版本中,websockets 可以正常工作,但是在将应用程序迁移到 tomcat 8.5 时,websockets 无法正常工作,并显示以下内容
WebSocket connection to 'ws://127.0.0.1/eventos/primepush/campanyas/ini/52501/52594/52595/52596/1536/1536/fin/2C53B02B2088FA5DA639DA21532E6BA9?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.0.3-jquery&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 200
Websocket failed. Downgrading to Comet and resending
这是使用的配置
web.xml
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.websocket.maxTextMessageSize</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
<param-value>org.atmosphere.cache.UUIDBroadcasterCache</param-value>
</init-param>
<async-supported>true</async-supported>
</servlet>
pom.xml
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<!-- <version>2.0.4</version> -->
<version>2.1.3</version>
</dependency>
知道我可以在哪里解决这个问题吗?
解决方案
推荐阅读
- java - 从混合了字符串和整数的数组中解析整数
- postgresql - PostgreSQL 的分发、安装和连接
- javascript - 根据计数打破 Object.keys 循环
- typescript - 条件可选参数类型
- angular - 拦截器未触发
- c++ - 重载输入 (>>) 运算符以获取枚举字符串
- python - 熊猫数据框按特定值分组
- jpa - 如何在 JPA 应用程序中保留实体的编辑历史
- python - Pod 错误 - fastparquet 的构建轮失败
- sql-server - 在 Azure Databricks 中使用 Python 将 DF 写入 SQL Server