Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-1078

NPE in client WebsocketHandler when reconnection fails

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0.2.Final
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      just stop websocket server (wildfly) after client connected

      Show
      just stop websocket server (wildfly) after client connected

      Description

      if the websocket connection fails, notifyDisconnected() method is called which nulls the webSocketChannel ref and starts a new connection retry. if that one fails, the notifyDisconnected() method is called and a NPE is raised when it tries to disconnectSocket(webSocketChannel) since the webSocketChannel is null.

      console log of client:

      Tue Oct 03 14:53:40 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: websocket closed with code: 1006
      webui-0.js:10658 14:53:40 INFO [WebsocketHandler] websocket closed with code: 1006
      webui-0.js:10634 Tue Oct 03 14:53:40 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: websocket disconnected
      webui-0.js:10658 14:53:40 INFO [WebsocketHandler] websocket disconnected
      webui-0.js:10634 Tue Oct 03 14:53:40 GMT+300 2017 org.jboss.errai.bus.client.api.ClientMessageBus
      WARNING: the connection to the server has been interrupted ...
      Nqb @ webui-0.js:10634
      kod @ webui-0.js:9401
      jod @ webui-0.js:6237
      qod @ webui-0.js:5707
      o4c @ webui-0.js:2704
      r4c @ webui-0.js:5148
      Wtd @ webui-0.js:10261
      yxd @ webui-0.js:10657
      onclose @ webui-0.js:9288
      webui-0.js:10658 14:53:40 WARNING [ClientMessageBus] the connection to the server has been interrupted ...
      Tue Oct 03 14:53:41 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: attempting reconnection ...
      webui-0.js:10658 14:53:41 INFO [WebsocketHandler] attempting reconnection ...
      webui-0.js:10634 Tue Oct 03 14:53:41 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: attempting web sockets connection at URL: wss://rom-gabora.liveu.tv:8543/luc/luc-webui/in.erraiBusWS
      webui-0.js:10658 14:53:41 INFO [WebsocketHandler] attempting web sockets connection at URL: wss://rom-gabora.liveu.tv:8543/luc/luc-webui/in.erraiBusWS
      webui-0.js:9288 WebSocket connection to 'wss://rom-gabora.liveu.tv:8543/luc/luc-webui/in.erraiBusWS' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
      axd @ webui-0.js:9288
      bxd @ webui-0.js:7155
      Exd @ webui-0.js:10657
      hg @ webui-0.js:10633
      C5g @ webui-0.js:5201
      _g @ webui-0.js:3603
      dh @ webui-0.js:8453
      (anonymous) @ webui-0.js:5613
      webui-0.js:10634 Tue Oct 03 14:53:42 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: websocket disconnected
      webui-0.js:10658 14:53:42 INFO [WebsocketHandler] websocket disconnected
      ISC_Core.js:1060 *14:53:42.101:WARN:Log:TypeError: Cannot read property 'close' of null
      Stack from error.stack:
      exd.yxd() @ webui-0.js:10657:28155
      WebSocket.onerror() @ webui-0.js:9288:642

      isc.B.push.isc.A.addToMasterLog @ ISC_Core.js:1060
      isc_c_Log_addLogMessage @ ISC_Core.js:1059
      isc_c_Log_log @ ISC_Core.js:1052
      logMessage @ ISC_Core.js:1041
      logWarn @ ISC_Core.js:1041
      isc_debug_reportJSErrorStack @ ISC_Core.js:1014
      isc_debug_reportJSError @ ISC_Core.js:1014
      window.onerror @ ISC_Core.js:1100
      webui-0.js:10657 Uncaught TypeError: Cannot read property 'close' of null
      at exd.yxd [as iE] (webui-0.js:10657)
      at WebSocket.onerror (webui-0.js:9288)
      yxd @ webui-0.js:10657
      onerror @ webui-0.js:9288
      webui-0.js:10634 Tue Oct 03 14:53:42 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: websocket closed with code: 1006
      webui-0.js:10658 14:53:42 INFO [WebsocketHandler] websocket closed with code: 1006
      webui-0.js:10634 Tue Oct 03 14:53:42 GMT+300 2017 org.jboss.errai.bus.client.framework.transports.WebsocketHandler
      INFO: websocket disconnected
      webui-0.js:10658 14:53:42 INFO [WebsocketHandler] websocket disconnected
      ISC_Core.js:1060 *14:53:42.105:WARN:Log:TypeError: Cannot read property 'close' of null
      Stack from error.stack:
      exd.yxd() @ webui-0.js:10657:28155
      WebSocket.onclose() @ webui-0.js:9288:488
      isc.B.push.isc.A.addToMasterLog @ ISC_Core.js:1060
      isc_c_Log_addLogMessage @ ISC_Core.js:1059
      isc_c_Log_log @ ISC_Core.js:1052
      logMessage @ ISC_Core.js:1041
      logWarn @ ISC_Core.js:1041
      isc_debug_reportJSErrorStack @ ISC_Core.js:1014
      isc_debug_reportJSError @ ISC_Core.js:1014
      window.onerror @ ISC_Core.js:1100
      webui-0.js:10657 Uncaught TypeError: Cannot read property 'close' of null
      at exd.yxd [as iE] (webui-0.js:10657)
      at WebSocket.onclose (webui-0.js:9288)
      yxd @ webui-0.js:10657
      onclose @ webui-0.js:9288

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                ggaborg Gabor Andras
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: