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

Can't establish a WebSocket connection in Tomcat 10

    XMLWordPrintable

Details

    Description

      Steps to Reproduce

      Use 9.6.0-jakarta FL in Tomcat 10, and open WebSocket

      <!-- zk.xml -->
      <listener>
      	<listener-class>org.zkoss.zkmax.au.websocket.WebSocketWebAppInit</listener-class>
      </listener>
      
      <!-- test.zul -->
      <zk>
          <button onClick="Clients.log(event.toString())" label="test event"/>
      </zk>
      

      Current Result

      java.lang.IllegalStateException: The response object has been recycled and is no longer associated with this facade

      Expected Result

      Established a WebSocket connection

      Debug Information

      WebSocketEndPoint.java
      -> public void onMessage(String message) {
      -> private void process(Session wsession, String message) throws IOException
      -> old = I18Ns.setup(_session, request, response, "UTF-8");
      -> final Object ol = Charsets.setup(hsess, request, response, charset);
      -> response.setCharacterEncoding(charset);

      Since the handshake response object has been recycled, so an exception was thrown.

      Workaround


      Attachments

        Issue Links

          Activity

            People

              rudyhuang rudyhuang
              rudyhuang rudyhuang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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