Description
NPE can occasionally occur inside WicketEndpoint. In our system we have a intermediary page for logging out. Meaning we go from home -> logout -> login page. These transitions are very quick and have occasionally hit this NPE.
Expected behavior do not throw a NPE when page is transitioning and an onOpen call has not been made yet. And do not throw a NPE when onClose is called before onOpen.
Possible solution:
check for null javaxWebSocketProcessor
WicketEndpoint:99 - An error occurred in web socket connection with id : 5ajava.lang.NullPointerException at org.apache.wicket.protocol.ws.javax.WicketEndpoint.onClose(WicketEndpoint.java:86) at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:555) at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:501) at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:459) at org.apache.tomcat.websocket.WsSession.close(WsSession.java:446) at org.apache.wicket.protocol.ws.javax.JavaxWebSocketConnection.close(JavaxWebSocketConnection.java:68) ****************************OUR PAGE CALLS CLOSE******************* at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:598) at org.apache.wicket.core.request.handler.ListenerRequestHandler.internalInvoke(ListenerRequestHandler.java:306) at org.apache.wicket.core.request.handler.ListenerRequestHandler.invoke(ListenerRequestHandler.java:280) at org.apache.wicket.core.request.handler.ListenerRequestHandler.invokeListener(ListenerRequestHandler.java:222) at org.apache.wicket.core.request.handler.ListenerRequestHandler.respond(ListenerRequestHandler.java:208) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:914) at org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65) at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:282) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221) at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:275) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:206) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:299) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at