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

Websocket implementation fails on Tomcat 8/8.5

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: Freshly, 8.5.0
    • Fix Version/s: 8.5.0
    • Component/s: ZK Update Engine
    • Security Level: Jimmy
    • Labels:
    • Environment:

      Tomcat 8 / 8.5 fails
      Jetty 9.4 works

      Description

      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()

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

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