Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java JBoss EAP 6.1上的Atmosphere和WebSocket_Java_Jboss_Websocket_Atmosphere - Fatal编程技术网

Java JBoss EAP 6.1上的Atmosphere和WebSocket

Java JBoss EAP 6.1上的Atmosphere和WebSocket,java,jboss,websocket,atmosphere,Java,Jboss,Websocket,Atmosphere,我试图在JBoss EAP 6.1上部署标准的大气聊天示例(您可以找到源代码和war) 大气应该在可用时处理WebSocket协议,或者在不可用时回退到长轮询 聊天可以工作,但是使用长轮询:JBoss似乎不支持WebSocket,但是有一种()建议的方法可以通过添加Tomcat本机连接器(aka APR)来启用它 我按照那些指示做,运气不好 这就是我部署这场战争时发生的事情(我自己构建它不会改变任何事情): 客户端:谷歌Chrome 35.0.1916.114 一旦我加载页面: Invoking

我试图在JBoss EAP 6.1上部署标准的大气聊天示例(您可以找到源代码和war)

大气应该在可用时处理WebSocket协议,或者在不可用时回退到长轮询

聊天可以工作,但是使用长轮询:JBoss似乎不支持WebSocket,但是有一种()建议的方法可以通过添加Tomcat本机连接器(aka APR)来启用它

我按照那些指示做,运气不好

这就是我部署这场战争时发生的事情(我自己构建它不会改变任何事情):

客户端:谷歌Chrome 35.0.1916.114

一旦我加载页面:

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

部署成功,但只要我加载网页,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?
有人有什么建议吗

编辑:

正如我所写的,我遵循了这里的指示:,但没有任何改变。 我的主要障碍是安装APR。有人能详细解释一下如何在windows上安装它吗


谢谢大家!

您需要从JBoss服务器启用APR。 为此,请转到Jboss/Domain/configuration文件夹并编辑Domain.xml文件。 发现 将native=“false”改为native=“true”

如果这不起作用,那么对standalone.xml文件执行相同的操作。

正如所说的,Jboss上对WebSocket的支持从EAP 6.3开始

但是,我测试了您在Tomcat8.0.15上链接的.war,它的工作方式非常好,因此我认为您可以很容易地找到另一个支持web套接字的WS/AS


希望这有帮助。

嗨,你能解决这个问题吗?我也被困在这个问题上。无法解决,但请看下面的答案:)谢谢:)。它在Widfly8.x上可以轻松工作,但对于Jboss EAP 6.1,仍然不知道如何解决这个问题。尝试了很多东西(将本机更改为true,显式添加jboss本机,在context.xml中进行修改等),但都没有成功。不幸的是,我不能离开EAP6.1,至少一年。