我认为您在打开websocket时正在尝试连接到不存在的端点。
这(请注意,您错过了
/../):
var wsUri = "ws://" + document.location.hostname + ":8000" +document.location.pathname + "/../serverendpoint";
…将适用于您部署到WildFly的文件,如下所示:
├── pom.xml└── src └── main ├── java │ └── testing │ └── serverendpoint.java └── webapp ├── MyTest.html └── WEB-INF └── web.xml
我已经在OpenShift Online上的WildFly 10磁带上使用您的代码(带有修改的端点路径)检查了此内容。



