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

Websocket implementation fails on Tomcat 8/8.5

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.0
    • Freshly, 8.5.0
    • ZK Update Engine
    • Security Level: Jimmy
    • Tomcat 8 / 8.5 fails
      Jetty 9.4 works

    • None

      1.
      connecting to ZK's websocket endpoint results in the following error message:

      zk.wpd:997 WebSocket connection to 'ws://robert-nb:8080/zk-rxdemo/zkwm/?dtid=z_589' failed: Error during WebSocket handshake: Unexpected response code: 404
      

      The endpoint configuration uses a trailing slash "/zkwm/" (should be without it "/zkwm")

      2.
      secondary issue happens during WebSocketEndPoint onOpen

      java.lang.NullPointerException
              at org.zkoss.zkmax.au.websocket.WebSocketEndPoint.onOpen(WebSocketEndPoint.java:89)
              at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:127)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:717)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
      

      The _httpRequest member doesn't contain the http session anymore (seems like tomcat is cleaning this up)

      The _httpSession can be retrieved via (HttpSession)_session.getNativeSession()

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

              Created:
              Updated:
              Resolved:

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