title: Atmosphere and WebSocket on JBoss EAP 6.1
body: <p>I'm trying to deploy the standard <strong>Atmosphere chat sample</strong> (you can find source code <a href="https://github.com/Atmosphere/atmosphere-samples/tree/master/samples/chat" rel="nofollow">here</a> and war <a href="http://search.maven.org/remotecontent?filepath=org/atmosphere/samples/atmosphere-chat/2.1.4/atmosphere-chat-2.1.4.war" rel="nofollow">here</a>) on JBoss EAP 6.1.</p>
  
  <p>Atmosphere is supposed to handle WebSocket Protocol when available or to fallback to long-polling when not.</p>
  
  <p>Chat works, but using long-polling: JBoss seems not to support <strong>WebSocket</strong>, but there is (<a href="https://github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support" rel="nofollow">here</a>) a suggested way to enable it by adding Tomcat Native Connector (aka APR).</p>
  
  <p>I followed those instructions with no luck.</p>
  
  <p>That's what happens when I deploy that war (building it by myself doesn't change anything):</p>
  
  <p><strong>Client-side: Google Chrome 35.0.1916.114</strong></p>
  
  <p>As soon as I load the page:</p>
  
  <pre><code>Invoking executeWebSocket atmosphere.js:3002
  Using URL: ws://localhost:8080/atmosphere-chat/chat?X-Atmosphere-tracking-id=0&amp;X-Atmosphere-Framework=2.2.0-javascript&amp;X-Atmosphere-Transport=websocket&amp;X-Atmosphere-TrackMessageSize=true&amp;X-Cache-Date=0&amp;Content-Type=application/json&amp;X-atmo-protocol=true atmosphere.js:3002
  WebSocket connection to 'ws://localhost:8080/atmosphere-chat/chat?X-Atmosphere-tracking-id=0&amp;X-Atmosphere-Framework=2.2.0-javascript&amp;X-Atmosphere-Transport=websocket&amp;X-Atmosphere-TrackMessageSize=true&amp;X-Cache-Date=0&amp;Content-Type=application/json&amp;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
  </code></pre>
  
  <p><strong>Server-side: JBoss EAP 6.1</strong></p>
  
  <p>The deployment succeds, but as soon as I load the web page JBoss outputs this:</p>
  
  <pre><code>[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?
  </code></pre>
  
  <p>Does anybody have any suggestions?</p>
  
  <p>Edit:</p>
  
  <p>As I wrote, I've followed the instructions here: <a href="https://github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support" rel="nofollow">https://github.com/Atmosphere/atmosphere/wiki/Installing-JBoss-WebSocket-Support</a>, but nothing changed.
  My main obstacle is the installation of APR. May anybody explain in detail me how to install it on windows?</p>
  
  <p>Thank you!</p>