By calling BayeuxServer.setTransports(...)
with just one transport, you basically disable any fall back capability since you are explicitly telling CometD to use 1 transport only.
Class LongPollingTransport
has 2 subclasses depending on the specific mechanism to use; you may want to use class JSONTransport
.
Note that the CometD documentation has an example of how to setup WebSocket with Spring using XML, but it is enough to translate the XML into code to have it working with annotations.
Basically, it all boils down to:
bayeuxServer.setTransports(new WebSocketTransport(bayeuxServer), new JSONTransport(bayeuxServer));