简体   繁体   English

JBoss EAP 6.1上的Atmosphere和WebSocket

[英]Atmosphere and WebSocket on JBoss EAP 6.1

I'm trying to deploy the standard Atmosphere chat sample (you can find source code here and war here ) on JBoss EAP 6.1. 我正在尝试在JBoss EAP 6.1上部署标准的Atmosphere聊天示例 (您可以在此处找到源代码在此处进行查看 )。

Atmosphere is supposed to handle WebSocket Protocol when available or to fallback to long-polling when not. 大气应该在可用时处理WebSocket协议,或者在不可用时回退到长轮询。

Chat works, but using long-polling: JBoss seems not to support WebSocket , but there is ( here ) a suggested way to enable it by adding Tomcat Native Connector (aka APR). 聊天有效,但是使用了长轮询:JBoss似乎不支持WebSocket ,但是( 这里 )有一种建议的方法,可以通过添加Tomcat Native Connector(又名APR)来启用它。

I followed those instructions with no luck. 我没有运气遵循这些指示。

That's what happens when I deploy that war (building it by myself doesn't change anything): 那就是我部署那场战争时发生的事情(我自己建造它不会改变任何东西):

Client-side: Google Chrome 35.0.1916.114 客户端:Google Chrome 35.0.1916.114

As soon as I load the page: 一旦加载页面:

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

Server-side: JBoss EAP 6.1 服务器端:JBoss EAP 6.1

The deployment succeds, but as soon as I load the web page JBoss outputs this: 部署成功,但是一旦我加载网页,JBoss就会输出以下内容:

[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?

Does anybody have any suggestions? 有人有什么建议吗?

Edit: 编辑:

As I wrote, I've followed the instructions here: https://github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support , but nothing changed. 如我所写,我已经按照此处的说明进行操作: https : //github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support ,但没有任何更改。 My main obstacle is the installation of APR. 我的主要障碍是安装APR。 May anybody explain in detail me how to install it on windows? 谁能详细解释我如何在Windows上安装它?

Thank you! 谢谢!

As said here support for websockets on Jboss starts from EAP 6.3. 至于说这里的WebSockets的支持在JBoss EAP从6.3开始。

However I tested the .war you linked on Tomcat 8.0.15 and it works like a charm, so I think you can easily find another WS/AS that supports web sockets. 但是,我测试了您在Tomcat 8.0.15上链接的.war,它像一个魅力一样工作,因此我认为您可以轻松地找到另一个支持Web套接字的WS / AS。

Hope this helped. 希望这会有所帮助。

You need to enable your APR from JBoss server. 您需要从JBoss服务器启用APR。 For this go to Jboss/Domain/configuration folder and edit the domain.xml file. 为此,转到Jboss / Domain / configuration文件夹并编辑domain.xml文件。 find make native ="false" to native ="true". 找到make native =“ false”到native =“ true”。

if this does not work then do the same thing to standalone.xml file. 如果这不起作用,则对standalone.xml文件执行相同的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM