Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3805

Websocket NPE when re-directing or refreshing page

XMLWordPrintable

    • ZK 8.5.1 R1

      Steps to Reproduce

      run the attached file js-redirect.zul

      Actual Result

      redirect to second page happens.
      quite often this leads to an NPE at server side

      Nov 27, 2017 12:32:28 PM org.eclipse.jetty.server.HttpChannel handleException
      WARNING: /zksupport85/zkwm
      java.lang.NullPointerException
      	at org.zkoss.zkmax.au.websocket.WSHandshakeRequest.<init>(WSHandshakeRequest.java:55)
      	at org.zkoss.zkmax.au.websocket.WebSocketFilter.doFilter(WebSocketFilter.java:41)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
      

      In the network request you can see a status 500 for the /zkwm request

      Expected Result

      no NPE at serverside (or logged properly if unavoidable)
      websocket closed from client side (prevent creation if possible after a redirect)

      Debug Info

      In the Chrome Network logs the request to /zkwm happens after the rmDeskop command
      At serverside the desktop is already gone at that moment causing the NPE.

      The error also happens when refreshing a zul multiple times rapidly (requires the right timing)

      Workaround

      not necessary
      The issue doesn't impact a running application since it only happens with already destroyed desktops.

        1. js-redirect.zul
          0.3 kB
          cor3000
        2. websocket.zul
          0.2 kB
          cor3000

            wenninghsu wenninghsu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h