[ 
https://issues.apache.org/jira/browse/WICKET-6091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134346#comment-15134346
 ] 

Jan Krakora edited comment on WICKET-6091 at 2/5/16 3:45 PM:
-------------------------------------------------------------

I'm sure. The request url from the original (copied) {{HttpServletRequest}} is 
{{null}}. 
Note that the original request is of type 
{{org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest}} and its 
requestURL is {{null}} but its requestUri is 
{{/chystat/wicket/websocket?pageId=13&wicket-ajax-baseurl=monitoring%2Foverview%3F13&wicket-app-name=chystat.wicket}}


was (Author: jan-krakora):
I'm sure. The request url from the original (copied) {{HttpServletRequest}} is 
{{null}}. 
//Note that the original request is of type 
{{org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest}} and its 
requestURL is {{null}} but its requestUri is 
{{/chystat/wicket/websocket?pageId=13&wicket-ajax-baseurl=monitoring%2Foverview%3F13&wicket-app-name=chystat.wicket}}

> NPE in RequestLoggerRequestCycleListener when using native-websockets
> ---------------------------------------------------------------------
>
>                 Key: WICKET-6091
>                 URL: https://issues.apache.org/jira/browse/WICKET-6091
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-native-websocket
>    Affects Versions: 7.2.0
>            Reporter: Jan Krakora
>            Assignee: Martin Grigorov
>
> When using wicket-native-websockets and setting 
> {code}
> getRequestLoggerSettings().setRequestLoggerEnabled(true)
> {code} 
> in the Wicket application, I get 
> {code}
> 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]
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to