You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thomas Schemmick (JIRA)" <ji...@apache.org> on 2017/10/13 11:06:03 UTC

[jira] [Created] (WICKET-6483) JavaxUpgradeHttpRequest can cause NullPointerException

Thomas Schemmick created WICKET-6483:
----------------------------------------

             Summary: JavaxUpgradeHttpRequest can cause NullPointerException
                 Key: WICKET-6483
                 URL: https://issues.apache.org/jira/browse/WICKET-6483
             Project: Wicket
          Issue Type: Bug
          Components: wicket-native-websocket
    Affects Versions: 7.9.0
            Reporter: Thomas Schemmick
            Assignee: Martin Grigorov
            Priority: Minor


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:
{code:java}
this.sessionId = request.getSession(true).getId();
{code}
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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)