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

NPE in RequestLoggerRequestCycleListener when using native-websockets

    XMLWordPrintableJSON

    Details

      Description

      When using wicket-native-websockets and setting

      getRequestLoggerSettings().setRequestLoggerEnabled(true)
      

      in the Wicket application, I get

      java.lang.NullPointerException: null
      	at org.apache.wicket.util.string.AppendingStringBuffer.<init>(AppendingStringBuffer.java:91) ~[wicket-util-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.http.RequestLoggerRequestCycleListener.registerRequestedUrl(RequestLoggerRequestCycleListener.java:108) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.http.RequestLoggerRequestCycleListener.onBeginRequest(RequestLoggerRequestCycleListener.java:46) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycleListenerCollection$1.notify(RequestCycleListenerCollection.java:65) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycleListenerCollection$1.notify(RequestCycleListenerCollection.java:61) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80) ~[wicket-util-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onBeginRequest(RequestCycleListenerCollection.java:60) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycleListenerCollection$1.notify(RequestCycleListenerCollection.java:65) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycleListenerCollection$1.notify(RequestCycleListenerCollection.java:61) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80) ~[wicket-util-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycleListenerCollection.onBeginRequest(RequestCycleListenerCollection.java:60) ~[wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:217) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) [wicket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.broadcastMessage(AbstractWebSocketProcessor.java:242) [wicket-native-websocket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.onConnect(AbstractWebSocketProcessor.java:173) [wicket-native-websocket-core-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.ws.javax.JavaxWebSocketProcessor.<init>(JavaxWebSocketProcessor.java:48) [wicket-native-websocket-javax-7.2.0.jar:7.2.0]
      	at org.apache.wicket.protocol.ws.javax.WicketEndpoint.onOpen(WicketEndpoint.java:58) [wicket-native-websocket-javax-7.2.0.jar:7.2.0]
      	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:129) [tomcat7-websocket.jar:7.0.55]
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) [tomcat-coyote.jar:7.0.55]
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) [tomcat-coyote.jar:7.0.55]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_72]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_72]
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.55]
      	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_72]
      

      It happens when the WebSocket is created.

      The org.apache.wicket.protocol.ws.api.ServletRequestCopy should return the request URL or the org.apache.wicket.util.string.AppendingStringBuffer should accept null in its constructor.

        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: