首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >大气与WebSocket在JBoss EAP 6.1上的应用

大气与WebSocket在JBoss EAP 6.1上的应用
EN

Stack Overflow用户
提问于 2014-05-27 15:37:33
回答 2查看 2.8K关注 0票数 2

我正在尝试在EAP6.1上部署标准的气氛聊天示例(您可以找到源代码这里和war 这里)。

气氛应该在可用时处理WebSocket协议,或者在没有时返回到长轮询。

聊天工作,但使用长轮询: JBoss似乎不支持WebSocket,但是有(这里)建议通过添加Tomcat本地连接器(也称为APR)来启用它。

我没有运气地按照那些指示行事。

当我部署这场战争时,就会发生这种情况(单独构建它不会改变任何事情):

客户端:GoogleChrome35.0.1916.114

一旦我加载页面:

代码语言:javascript
复制
Invoking executeWebSocket atmosphere.js:3002
Using URL: ws://localhost:8080/atmosphere-chat/chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.0-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true atmosphere.js:3002
WebSocket connection to 'ws://localhost:8080/atmosphere-chat/chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.2.0-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 501 atmosphere.js:1060
WebSocket not connected. atmosphere.js:3002
Websocket failed. Downgrading to Comet and resending atmosphere.js:3002
Websocket failed. Downgrading to Comet and resending atmosphere.js:3002

服务器端: JBoss EAP 6.1

部署成功,但一旦我加载web页面,JBoss就会输出以下内容:

代码语言:javascript
复制
[org.atmosphere.container.JBossWebCometSupport] (http-/127.0.0.1:8080-7) HttpEvent is null, JBoss APR Not Properly installed
[org.atmosphere.cpr.AtmosphereFramework] (http-/127.0.0.1:8080-7) Failed using comet support: org.atmosphere.container.JBossWebCometSupport, error: JBoss failed to detect this is a Comet application because the APR Connector is not enabled. 
Make sure atmosphere-compat-jboss.jar is not under your WEB-INF/lib and You must use the atmosphere-native-runtime dependency in order to use native Comet Support
there is no context.xml under WEB-INF Is the NIO or APR Connector enabled?

有人有什么建议吗?

编辑:

正如我所写的,我遵循了这里的说明:https://github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support,但是没有什么改变。我的主要障碍是安装APR。有人能详细解释一下如何在窗户上安装它吗?

谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-11-21 16:28:25

如前所述,这里对websockets的支持从EAP6.3开始。

不过,我测试了您在Tomcat8.0.15上链接的.war,它运行起来很有魅力,所以我认为您可以很容易地找到另一个支持web套接字的WS/AS。

希望这能帮上忙。

票数 2
EN

Stack Overflow用户

发布于 2014-07-09 12:03:54

您需要从JBoss服务器启用您的APR。为此,请转到Jboss/Domain/configuration文件夹并编辑domain.xml文件。找到使本机=“假”到本机=“真”。

如果这不起作用,那么对standalone.xml文件做同样的事情。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23893556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档