title: Simplest possible working cometd java client
body: <p>I've been trying to get a very simple cometd java server and client setup, using cometd version 3.1.2 and jetty 9.4.6.v20170531, using the code from cometd's documentation.</p>
  
  <pre><code>HttpClient httpClient = new HttpClient();
  httpClient.start();
  
  Map&lt;String, Object&gt; options = new HashMap&lt;String, Object&gt;();
  ClientTransport transport = new LongPollingTransport(options, httpClient);
  BayeuxClient client = new BayeuxClient("http://localhost:9025/mycontext/cometd/", transport);
  
  client.handshake();
  boolean handshaken = client.waitFor(5000, BayeuxClient.State.CONNECTED);
  if (handshaken) {
    System.out.println("Yes");
    // Here handshake is successful
  }
  System.out.println("Done");
  </code></pre>
  
  <p>The server setup is what I'm really interested in, and is a spring injected embedded jetty server with the cometd servlet. No matter what I've tried the client will not handshake. I was finally able to prove that the server is correctly setup and available by send this request via postman...</p>
  
  <p>POST <a href="http://localhost:9025/mycontext/cometd" rel="nofollow noreferrer">http://localhost:9025/mycontext/cometd</a></p>
  
  <pre><code>[{
      "version": "1.0",
      "minimumVersion": "0.9",
      "channel": "/meta/handshake",
      "supportedConnectionTypes": [
          "long-polling", 
          "callback-polling"
      ],
      "advice": {
          "timeout": 60000,
          "interval": 0
      },
      "id": "1"
  }]
  </code></pre>
  
  <p>...which returns a 200...</p>
  
  <pre><code>[
      {
          "minimumVersion": "1.0",
          "clientId": "11jlmrekgqnu9v1i4w1b8rgiq3c",
          "supportedConnectionTypes": [
              "long-polling",
              "websocket"
          ],
          "advice": {
              "interval": 0,
              "timeout": 60000,
              "reconnect": "retry"
          },
          "channel": "/meta/handshake",
          "id": "1",
          "version": "1.0",
          "successful": true
      }
  ]
  </code></pre>
  
  <p>...so, clearly, the server setup is fine. I've set break points and used tcpflow to look for traffic and from what I can tell, the simplest possible client using cometd's own libraries from their starter documentation never sends any request at all. No tcp traffic. Anyone know what I'm missing? Any help appreciated.</p>