首页 > 解决方案 > AWS EC2 中的 JSF Websocket 在 localhost 但不在 EC2 (AWS) 上工作

问题描述

我正在使用 <f:websocket> 来更新聊天页面。

该应用程序在 Wildfly 20 中运行,并且在 localhost 中运行良好,但 websocket 在 EC2 AWS 实例上出现以下错误。

jsf.js.xhtml?ln=javax.faces:1 WebSocket connection to 'wss://app.mydomain.com/javax.faces.push/incomingPush?8c34119c-cd10-41ca-bc13-65494ce18d4f' failed: Error during WebSocket handshake: Unexpected response code: 404 

我还在wildfly日志中发现了这个错误,我认为它有事情要做(因为在localhost中我没有收到这个错误):

2020-12-17 18:40:44,641 ERROR [org.jboss.weld.Bean] (default task-9) WELD-000019: Error destroying an instance com.sun.faces.push.WebsocketChannelManager$ViewScope@6d608a43 of Managed Bean [class com.sun.faces.push.WebsocketChannelManager$ViewScope] with qualifiers [@Any @Default]

我已经被这个问题困扰了一个星期了。任何帮助将不胜感激。

谢谢!

标签: amazon-web-servicesjsfamazon-ec2websocket

解决方案


推荐阅读