Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6277

Broadcasting ClosedMessage about the JSR 356 WebSocket connection after the container was turned off

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.4.0
    • Fix Version/s: 7.6.0, 8.0.0-M3
    • Labels:
      None
    • Environment:
      Windows 10, Tomcat 8.0.33, JDK 1.8.0_91

      Description

      Whenever is the servlet container (Tomcat in my case) turned off it closes all established ws connections. Wicket reacts to that by broadcasting a ClosedMessage to a Page bounded to that connection. And that is a problem since before that, org.apache.wicket.protocol.http.WicketFilter#destroy() is called and (among others) the IPageManager is destroyed.

      It leads to a NPE:

      java.lang.NullPointerException: null
      	at org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:203)
      	at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:357)
      	at org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:82)
      	at org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50)
      	at org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:246)
      	at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.getPage(AbstractWebSocketProcessor.java:315)
      	at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.broadcastMessage(AbstractWebSocketProcessor.java:243)
      	at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.onClose(AbstractWebSocketProcessor.java:182)
      	at org.apache.wicket.protocol.ws.javax.WicketEndpoint.onClose(WicketEndpoint.java:71)
      	at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:541)
      	at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:490)
      	at org.apache.tomcat.websocket.WsSession.close(WsSession.java:454)
      	at org.apache.tomcat.websocket.WsWebSocketContainer.destroy(WsWebSocketContainer.java:926)
      	at org.apache.tomcat.websocket.server.WsServerContainer.destroy(WsServerContainer.java:285)
      	at org.apache.tomcat.websocket.server.WsContextListener.contextDestroyed(WsContextListener.java:48)
      	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4856)
      	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5474)
      	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
      	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
      	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      I think it would be good idea to NOT broadcast ClosedMessage when the Application is already destroyed.

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              jan-krakora Jan Krakora
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: