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

websockets NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.5.1
    • 9.0.0, 8.6.4
    • ZK Update Engine
    • Security Level: Jimmy
    • ZK 9.5.1 S1

      Steps to Reproduce

      Follow the example to use ZK's Websocket utilities

      https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/Integration/Miscellenous/Websocket_Channel

      Current Result

      Sep 03, 2020 4:16:34 PM org.eclipse.jetty.server.HttpChannel handleException
      WARNING: /zksupport86/echo/
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.http.ZKWebSocket.extractConnectionUuid(ZKWebSocket.java:106)
      	at org.zkoss.zk.ui.http.ZKWebSocket.modifyHandshake(ZKWebSocket.java:56)
      	at org.eclipse.jetty.websocket.jsr356.server.JsrCreator.createWebSocket(JsrCreator.java:149)
      	at org.eclipse.jetty.websocket.server.WebSocketServerFactory.acceptWebSocket(WebSocketServerFactory.java:230)
      	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:258)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1638)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:567)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
      

      Expected Result

      No Exception/ working websocket connection
       

      Debug Information

      Missing NPE check in the implementation for ZK-4429
      https://github.com/zkoss/zk/blob/v9.1.0/zk/src/org/zkoss/zk/ui/http/ZKWebSocket.java#L106

      Workaround

      add an empty or random connection_uuid parameter to websocket urls

      /echo/?dtid=[desktop-id]&connection_uuid=

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d