Hello
I'm trying to develop an application using websocket. But when I try to establish the connection sometimes (yes, sometimes) work and sometimes it doesn't and never get 101 response.

I have a javascript file with:
var ws = new WebSocket("ws://" + document.location.host + "/chp/mediador");
and in the ServerEndpoint (named Mediador) the code in my onOpen method is executing. This is the code of this method:
@OnOpen
public void onOpen(Session sesion) {
LOGGER.log(Level.INFO, "Mediador.onOpen: sesion id: {0}", sesion.getId());
}
I can see the message: "Información: Mediador.onOpen: sesion id: X" (X is the number of the session -1,2,3,4...-)
But the next code in the javascript file:
ws.onopen = function (evento) {
console.log("websocket en " + document.location.pathname + " abierto");
...
never executes and after about 4 minutes my chrome console show the error:
"WebSocket connection to 'ws://localhost:8080/chp/mediador' failed: WebSocket opening handshake timed out"
I have disabled the firewall and have no antivirus installed in my server.
I'm using Chrome 44.0.2403.157
Can you help me?
Thanks!