The strange thing is that at line 181
https://github.com/apache/wicket/blob/build/wicket-6.1.1/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebResponse.java#L181

it seems that RequestCycle.get() returns null.
But at WicketFilter.processRequest(WicketFilter.java:198) the
RequestCycle threal local must be still available.

On Thu, Oct 11, 2012 at 6:23 PM, nemanjko <nemanja.kos...@gmail.com> wrote:
> Here is the full stack trace:
>
> java.lang.NullPointerException
>
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.encodeURL(ServletWebResponse.java:181)
>         
> ch.yugosi.view.WicketApplication$1.encodeURL(WicketApplication.java:121)
>
> ch.yugosi.view.WicketApplication$1.encodeRedirectURL(WicketApplication.java:125)
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:212)
> org.apache.wicket.protocol.http.BufferedWebResponse$SendRedirectAction.invoke(BufferedWebResponse.java:394)
> org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:582)
> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:89)
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:198)
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
>
> And this is the code that produces the error:
>         // remove jsessionid for search engines
>         protected WebResponse newWebResponse(final WebRequest webRequest, 
> final
> HttpServletResponse httpServletResponse){
>             return new ServletWebResponse((ServletWebRequest)webRequest,
> httpServletResponse) {
>               @Override
>               public String encodeURL(CharSequence url) {
>                   final String agent = webRequest.getHeader("User-Agent");
>                   return isAgent(agent) ? url.toString() : 
> super.encodeURL(url);
>               }
>               @Override
>               public String encodeRedirectURL(CharSequence url) {
>                   return encodeURL(url);
>               }
>             };
>         }
>
> To be honest, I have found this piece of code somewhere and just did
> copy&paste.
> It does look a bit suspicious especially encodeRedirectURL method which
> calls encodeURL again.

Yes, this seems like a bug.

>
> Nemanja
>
> I can live without this so it's not a big deal. Weird thing is that Wicket
> v6.0 didn't complaint but
> v6.1.1 is producing the error above.
>
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Bug-WICKET-4789-still-in-6-1-1-tp4652883p4652887.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to