You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Major Péter <ma...@sch.bme.hu> on 2010/08/13 01:35:09 UTC

Wicket 1.5-M1 causing IllegalStateException

Hi,

I have a page with the ~following markup:
<form>
 <table> (DataView)
  <tr><a href="link" /></tr>
 </table>
</form>

The link is constructed like:
Link valuationLink = new Link("valuationLink") {
    @Override
    public void onClick() {
        setResponsePage(new ValuationDetails(val, getPage()));
    }
};

When I click on this link, I get HTTP 500 and the following stacktrace:
java.lang.IllegalStateException
        at
org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:522)
        at
org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:232)
        at
org.apache.wicket.protocol.http.BufferedWebResponse$SendRedirectAction.invoke(BufferedWebResponse.java:275)
        at
org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:439)
        at
org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:87)
        at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:145)
        at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:188)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)

should I create JIRA issues instead of mailing them? :)

Regards,
Peter

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


Re: Wicket 1.5-M1 causing IllegalStateException

Posted by Major Péter <ma...@sch.bme.hu>.
> A better handling would be maybe in ServletWebResponse#sendRedirect to
> check whether redirect is already null, and throw a nice

I mean true, not null..

> wicketruntimeexception instead. (or find out, how could I have two
> sendredirectaction)

or both

Regards,
Peter

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


Re: Wicket 1.5-M1 causing IllegalStateException

Posted by Major Péter <ma...@sch.bme.hu>.
Hi,

thanks for the tip, but that had nothing to do with your breakpoint.
Stay tuned, EPIC bug:

The problem was basically, that the linked Page contained a not 1.5-M1
compatible TinyMCE component, which used old version of
ResourceReference. My Page class couldn't be loaded, since there was a
NoClassDefFoundError, since it couldn't find the ResourceReference class.

Now take a look at my onClick:
public void onClick() {
    setResponsePage(new ValuationDetails(val, getPage()));
}

the onClick is called with method.invoke(..), since the class couldn't
be loaded I have a nice InvocationTargetException, which is catched
nicely, this is handled great, but there is some another magic involved
there, which I haven't debug further, but in the end in
BufferedWebResponse#writeTo I have two SendRedirectActions, one is for
wicket/page?10 and one is for korok/consider?11 (I've started from
korok/consider), and this could only result in IllegalStateException.

A better handling would be maybe in ServletWebResponse#sendRedirect to
check whether redirect is already null, and throw a nice
wicketruntimeexception instead. (or find out, how could I have two
sendredirectaction)

Best Regards,
Peter

2010-08-13 10:02 keltezéssel, Martin Grigorov írta:
> The breakpoint should be
> at: org.apache.wicket.request.http.handler.RedirectRequestHandler.respond(IRequestCycle)
>  (wicket-request project)
> 
> On Fri, Aug 13, 2010 at 9:54 AM, Igor Vaynberg <ig...@gmail.com>wrote:
> 
>> 2010/8/12 Major Péter <ma...@sch.bme.hu>:
>>> Hi,
>>>
>>> I have a page with the ~following markup:
>>> <form>
>>>  <table> (DataView)
>>>  <tr><a href="link" /></tr>
>>>  </table>
>>> </form>
>>>
>>> The link is constructed like:
>>> Link valuationLink = new Link("valuationLink") {
>>>    @Override
>>>    public void onClick() {
>>>        setResponsePage(new ValuationDetails(val, getPage()));
>>>    }
>>> };
>>>
>>> When I click on this link, I get HTTP 500 and the following stacktrace:
>>> java.lang.IllegalStateException
>>>        at
>>>
>> org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:522)
>>>        at
>>>
>> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:232)
>>>        at
>>>
>> org.apache.wicket.protocol.http.BufferedWebResponse$SendRedirectAction.invoke(BufferedWebResponse.java:275)
>>>        at
>>>
>> org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:439)
>>>        at
>>>
>> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:87)
>>>        at
>>>
>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:145)
>>>        at
>>>
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:188)
>>>        at
>>>
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
>>>        at
>>>
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
>>>        at
>>>
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
>>>        at
>>>
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
>>>        at
>>>
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
>>>
>>
>> looks like the servlet container does not like the redirect url. can
>> you set a breakpoint and tell us what the original url is and what url
>> wicket is trying to redirect to?
>>
>>> should I create JIRA issues instead of mailing them? :)
>>
>> yeah, that will make things easier.
>>
>> -igor
>>>
>>> Regards,
>>> Peter

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


Re: Wicket 1.5-M1 causing IllegalStateException

Posted by Martin Grigorov <mg...@apache.org>.
The breakpoint should be
at: org.apache.wicket.request.http.handler.RedirectRequestHandler.respond(IRequestCycle)
 (wicket-request project)

On Fri, Aug 13, 2010 at 9:54 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> 2010/8/12 Major Péter <ma...@sch.bme.hu>:
> > Hi,
> >
> > I have a page with the ~following markup:
> > <form>
> >  <table> (DataView)
> >  <tr><a href="link" /></tr>
> >  </table>
> > </form>
> >
> > The link is constructed like:
> > Link valuationLink = new Link("valuationLink") {
> >    @Override
> >    public void onClick() {
> >        setResponsePage(new ValuationDetails(val, getPage()));
> >    }
> > };
> >
> > When I click on this link, I get HTTP 500 and the following stacktrace:
> > java.lang.IllegalStateException
> >        at
> >
> org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:522)
> >        at
> >
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:232)
> >        at
> >
> org.apache.wicket.protocol.http.BufferedWebResponse$SendRedirectAction.invoke(BufferedWebResponse.java:275)
> >        at
> >
> org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:439)
> >        at
> >
> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:87)
> >        at
> >
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:145)
> >        at
> >
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:188)
> >        at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> >        at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
> >        at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
> >        at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
> >        at
> >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
> >
>
> looks like the servlet container does not like the redirect url. can
> you set a breakpoint and tell us what the original url is and what url
> wicket is trying to redirect to?
>
> > should I create JIRA issues instead of mailing them? :)
>
> yeah, that will make things easier.
>
> -igor
> >
> > Regards,
> > Peter
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 1.5-M1 causing IllegalStateException

Posted by Igor Vaynberg <ig...@gmail.com>.
2010/8/12 Major Péter <ma...@sch.bme.hu>:
> Hi,
>
> I have a page with the ~following markup:
> <form>
>  <table> (DataView)
>  <tr><a href="link" /></tr>
>  </table>
> </form>
>
> The link is constructed like:
> Link valuationLink = new Link("valuationLink") {
>    @Override
>    public void onClick() {
>        setResponsePage(new ValuationDetails(val, getPage()));
>    }
> };
>
> When I click on this link, I get HTTP 500 and the following stacktrace:
> java.lang.IllegalStateException
>        at
> org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:522)
>        at
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(ServletWebResponse.java:232)
>        at
> org.apache.wicket.protocol.http.BufferedWebResponse$SendRedirectAction.invoke(BufferedWebResponse.java:275)
>        at
> org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:439)
>        at
> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.flush(HeaderBufferingWebResponse.java:87)
>        at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:145)
>        at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:188)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
>        at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
>        at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
>        at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
>        at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
>

looks like the servlet container does not like the redirect url. can
you set a breakpoint and tell us what the original url is and what url
wicket is trying to redirect to?

> should I create JIRA issues instead of mailing them? :)

yeah, that will make things easier.

-igor
>
> Regards,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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