title: Atmosphere socket established but no data being received/sent
body: <p>I am following the Atmosphere <a href="https://github.com/Atmosphere/atmosphere/wiki/Getting-Started-with-AtmosphereHandler,-WebSocket-and-Long-Polling" rel="nofollow">tutorial</a> to get a basic chat application setup. Currently when running the javascript, it appears to be able to establish a connection to the server using web sockets. I get the following in the Chrome console:</p>
  
  <pre><code>Invoking executeWebSocket core.js:2298
  Using URL: ws://localhost:8080/web-transport/chat?X-Atmosphere-tracking-id=0&amp;X-Atmosphere-Framework=1.1&amp;X-Atmosphere-Transport=websocket&amp;X-Cache-Date=0&amp;Content-Type=application/json core.js:2298
  Websocket successfully opened 
  </code></pre>
  
  <p>However, when I attempt to publish data (subSocket.push(...)) nothing seems to happen. I have tried debugging the AtmosphereHandlerService but it never seems to be hit (and no logs are being generated.</p>
  
  <p>What am I missing that would cause this?</p>
  
  <p>So far I have the following:</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:j2ee="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee    http://java.sun.com/xml/ns/j2ee/web-app_2.5.xsd"&gt;
      &lt;description&gt;AtmosphereServlet&lt;/description&gt;
      &lt;display-name&gt;AtmosphereServlet&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;description&gt;AtmosphereServlet&lt;/description&gt;
          &lt;servlet-name&gt;AtmosphereServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.atmosphere.cpr.AtmosphereServlet&lt;/servlet-class&gt;
          &lt;!-- If you want to use Servlet 3.0 --&gt;
          &lt;!-- &lt;async-supported&gt;true&lt;/async-supported&gt; --&gt;
          &lt;!-- List of init-param --&gt; 
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;AtmosphereServlet&lt;/servlet-name&gt;
          &lt;!-- Any mapping --&gt;
          &lt;url-pattern&gt;/chat/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>ChatAtmosphereHandler.java</p>
  
  <pre><code>@AtmosphereHandlerService(path = "/chat")
  public class ChatAtmosphereHandler implements AtmosphereHandler {
  
      public void onRequest(AtmosphereResource resource) throws IOException {
  
          AtmosphereRequest request = resource.getRequest();
  
          if (request.getMethod().equalsIgnoreCase("GET")) {
              resource.suspend();
          } else if (request.getMethod().equalsIgnoreCase("POST")) {
              resource.getBroadcaster().broadcast(request.getReader().readLine().trim());
          }
  
      }
  
      public void onStateChange(AtmosphereResourceEvent event) throws IOException {
  
          AtmosphereResource resource = event.getResource();
          AtmosphereResponse response = resource.getResponse();
  
          if (resource.isSuspended()) {
  
              response.getWriter().write("Hello");
  
              switch (resource.transport()) {
                  case JSONP:
                  case LONG_POLLING:
                      event.getResource().resume();
                      break;
                  case WEBSOCKET:
                  case STREAMING:
                      response.getWriter().flush();
                      break;
              }
  
          } else if (!event.isResuming()) {
              event.broadcaster().broadcast("bye bye");
          }
  
      }
  
      public void destroy() { 
      }
  
  }
  </code></pre>
  
  <p>Maven dependencies:</p>
  
  <pre><code> &lt;dependency&gt;
          &lt;groupId&gt;org.atmosphere&lt;/groupId&gt;
          &lt;artifactId&gt;atmosphere-runtime&lt;/artifactId&gt;
          &lt;version&gt;1.0.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.atmosphere&lt;/groupId&gt;
          &lt;artifactId&gt;atmosphere-jersey&lt;/artifactId&gt;
          &lt;version&gt;1.0.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;eu.infomas&lt;/groupId&gt;
          &lt;artifactId&gt;annotation-detector&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and finally the javascript:</p>
  
  <pre><code>$(document).ready(function() {
  
      var socket = $.atmosphere;
      var subSocket = null;
  
      var request = { 
          url: 'http://localhost:8080/web-transport/' + 'chat',
          contentType : "application/json",
          logLevel : 'debug',
          transport : 'websocket' ,
          fallbackTransport: 'long-polling'
      };
  
      request.onOpen = function(response) {
          console.log('onopen', response);
      };
  
      request.onReconnect = function (request, response) {
          console.log('onreconnect', request, response);
      };
  
      request.onMessage = function (response) {
          console.log('onmessage', response);
      };
  
      request.onError = function(response) {
          console.log('onerror', response);
      };
  
      $('#send').click(function(){
          subSocket.push(JSON.stringify({ author: 'me', message: 'hello' }));
      });
  
      $('#subscribe').click(function(){
          subSocket = socket.subscribe(request);
      });
  
  });
  </code></pre>