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

JavaxUpgradeHttpRequest can cause NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 7.9.0
    • None
    • None

    Description

      The method "getSession(boolean create)" from JavaxUpgradeHttpRequest does not match the specification given by the interface HttpServletRequest.
      It does not create a new HttpSession if "create" is true.
      This can cause a NullPointerException in AbstractWebSocketProcessor, in line 104:

      this.sessionId = request.getSession(true).getId();
      

      Full stacktrace:
      ERROR 13/10/2017 13:01 org.apache.coyote.http11.Http11NioProtocol: Error reading request, ignored
      java.lang.NullPointerException: null
      at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.<init>(AbstractWebSocketProcessor.java:104) ~[wicket-native-websocket-core-7.9.0.jar:7.9.0]
      at org.apache.wicket.protocol.ws.javax.JavaxWebSocketProcessor.<init>(JavaxWebSocketProcessor.java:46) ~[wicket-native-websocket-javax-7.9.0.jar:7.9.0]
      at org.apache.wicket.protocol.ws.javax.WicketEndpoint.onOpen(WicketEndpoint.java:64) ~[wicket-native-websocket-javax-7.9.0.jar:7.9.0]
      at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:133) ~[tomcat-embed-websocket-8.5.15.jar:8.5.15]
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:907) [tomcat-embed-core-8.5.15.jar:8.5.15]
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-embed-core-8.5.15.jar:8.5.15]
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.15.jar:8.5.15]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_141]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_141]
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.15.jar:8.5.15]
      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]

      This can happen when the client trys to create a new WebSocket connection after the session has run out.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              T.Schemmick Thomas Schemmick
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: