Reputation: 1628
I'm trying to deploy the standard Atmosphere chat sample (you can find source code here and war here) on JBoss EAP 6.1.
Atmosphere is supposed to handle WebSocket Protocol when available or to fallback to long-polling when not.
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).
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
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
The deployment succeds, but as soon as I load the web page JBoss outputs this:
[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. My main obstacle is the installation of APR. May anybody explain in detail me how to install it on windows?
Thank you!
Upvotes: 2
Views: 2842
Reputation: 36
As said here support for websockets on Jboss starts from 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.
Hope this helped.
Upvotes: 2
Reputation: 757
You need to enable your APR from JBoss server. For this go to Jboss/Domain/configuration folder and edit the domain.xml file. find make native ="false" to native ="true".
if this does not work then do the same thing to standalone.xml file.
Upvotes: 1