ahh got it.

it is this line (class.method)
at wicket.request.target.AbstractListenerInterfaceRequestTarget.invokeInterface(AbstractListenerInterfaceRequestTarget.java:225)

that one must also catch this:
        catch (InvocationTargetException e)
        {
            // honor redirect exception contract defined in IPageFactory
            if (e.getTargetException() instanceof AbstractRestartResponseException)
            {
                throw (RuntimeException)e.getTargetException();
            }

and throw really the real reason.
Maybe we should do that at a level below (in the steps method)
but then everything is already wrapped in a wicket exception most of the time (which holds again that invocation exception that holds the restart exception)
so that is also not that nice to do..

johan




On 2/7/06, Johan Compagner <[EMAIL PROTECTED] > wrote:
it doesn't go through that method that has that line 167
it goes through this one:

public final Page newPage(final Class pageClass)

But i tested it it and did throw RestartResponseAtInterceptPageException at a page that was made in that call and it works fine.

johan


On 2/7/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
that is strange
it should be handled here:

at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:56)

does your DefaultPageFactory.java have this at line 167?

            if ( e.getTargetException () instanceof AbstractRestartResponseException)
            {
                throw (RuntimeException)e.getTargetException();
            }

-Igor



On 2/7/06, Joe Toth <[EMAIL PROTECTED]> wrote:
I thought I shouldn't have to handle it, but if I don't have something like:

        @Override
        public Page onRuntimeException(Page page, RuntimeException e) {
                if ( e.getCause().getCause() instanceof
RestartResponseAtInterceptPageException) {
                        return page;
                }

                return super.onRuntimeException(page, e);
        }


...in the WebRequestCycle, then I get the following error.


Root cause:

wicket.RestartResponseAtInterceptPageException
at wicket.Component.<init>(Component.java:550)
at wicket.MarkupContainer.<init>(MarkupContainer.java:118)
at wicket.Page.<init>(Page.java:228)
at wicket.markup.html.WebPage.<init>(WebPage.java :76)
at wicket.markup.html.WebPage.<init>(WebPage.java:68)
at com.researchjunction.page.ResearchJunctionPage.<init>(ResearchJunctionPage.java:10)
at com.researchjunction.page.partner.PartnerAccountInformationPage .<init>(PartnerAccountInformationPage.java:18)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:56)
at wicket.markup.html.link.PageLink$1.getPage(PageLink.java:67)
at wicket.markup.html.link.PageLink.onClick(PageLink.java:146)
at wicket.markup.html.link.Link.onLinkClicked (Link.java:182)
at java.lang.reflect.Method.invoke(Method.java:585)
at wicket.request.target.AbstractListenerInterfaceRequestTarget.invokeInterface(AbstractListenerInterfaceRequestTarget.java:225)
at wicket.request.target.ListenerInterfaceRequestTarget.processEvents (ListenerInterfaceRequestTarget.java:75)
at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:62)
at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents (AbstractCompoundRequestCycleProcessor.java:57)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:805)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:870)
at wicket.RequestCycle.step (RequestCycle.java:970)
at wicket.RequestCycle.steps(RequestCycle.java:1025)
at wicket.RequestCycle.request(RequestCycle.java:514)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:205)
at javax.servlet.http.HttpServlet.service (HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch (WebApplicationHandler.java:473)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.jetty.servlet.WebApplicationContext.handle (WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java :816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java :244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Complete stack:

wicket.WicketRuntimeException: method onLinkClicked of interface
wicket.markup.html.link.ILinkListener targetted at component
[MarkupContainer [Component id = partnerAccountInformationPage, page =
com.researchjunction.page.guest.HomePage, path =
0:border:partnerAccountInformationPage.PageLink , isVisible = true,
isVersioned = true]] threw an exception
at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:62)
at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents (AbstractCompoundRequestCycleProcessor.java:57)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:805)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:870)
at wicket.RequestCycle.step (RequestCycle.java:970)
at wicket.RequestCycle.steps(RequestCycle.java:1025)
at wicket.RequestCycle.request(RequestCycle.java:514)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:205)

java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java:585)
at wicket.request.target.AbstractListenerInterfaceRequestTarget.invokeInterface(AbstractListenerInterfaceRequestTarget.java:225)
at wicket.request.target.ListenerInterfaceRequestTarget.processEvents (ListenerInterfaceRequestTarget.java:75)
at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:62)
at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents (AbstractCompoundRequestCycleProcessor.java:57)
at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:805)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:870)
at wicket.RequestCycle.step (RequestCycle.java:970)
at wicket.RequestCycle.steps(RequestCycle.java:1025)
at wicket.RequestCycle.request(RequestCycle.java:514)
at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:205)

On 2/7/06, Johan Compagner < [EMAIL PROTECTED]> wrote:
> that shouldn't be needed
> i don't see enough stacktrace (after at
> java.lang.reflect.Constructor.newInstance(Constructor.java :494)
> To see in what part of the wicket code it sits.
> Because we should catch those exceptions and handle them more silently.
>
> johan
>
>
>
> On 2/7/06, Joe Toth < [EMAIL PROTECTED]> wrote:
> >
> > Had to override onRuntimeException of WebRequestCycle to return the
> > page instead of null.
> >
> >         @Override
> >         public Page onRuntimeException(Page page, RuntimeException e) {
> >                 return page;
> >         }
> >
> >
> >
> > On 2/7/06, Joe Toth < [EMAIL PROTECTED]> wrote:
> > > Ok, great, now if I can just get it to redirect when not authorized...
> > >
> > > throwing RestartResponseAtSignInPageException(); during
> the
> > > authorizationInstantiation gives this exception...
> > >
> > > Root cause:
> > >
> > > wicket.RestartResponseAtInterceptPageException
> > > at wicket.Component.<init>(Component.java:550)
> > > at wicket.MarkupContainer.<init>(MarkupContainer.java :118)
> > > at wicket.Page.<init>(Page.java:228)
> > > at wicket.markup.html.WebPage.<init>(WebPage.java:76)
> > > at wicket.markup.html.WebPage.<init>( WebPage.java:68)
> > > at
> com.researchjunction.page.ResearchJunctionPage.<init>(ResearchJunctionPage.java:10)
> > > at
> com.researchjunction.page.partner.PartnerAccountInformationPage.<init>( PartnerAccountInformationPage.java
> :18)
> > > at
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> > >
> > > code...
> > >
> > >
> getSecuritySettings().setAuthorizationStrategy(
> > >                                 new
> IAuthorizationStrategy() {
> > >
> > >                                         public boolean
> authorizeAction(Component component,
> > >
> Action action) {
> > >                                                 // TODO
> Auto-generated method stub
> > >                                                 return
> true;
> > >                                         }
> > >
> > >                                         public boolean
> authorizeInstantiation(Class componentClass) {
> > >                                                 if
> (componentClass
> > >
>
> .equals(PartnerAccountInformationPage.class)) {
> > >
> throw new
> > >
> RestartResponseAtInterceptPageException(PartnerTouchpointPage.class);
> > >                                                 }
> > >                                                 return
> true;
> > >                                         }
> > >
> > >                                 });
> > >
> > > Thanks
> > >
> > > On 2/6/06, Jonathan Locke < [EMAIL PROTECTED]> wrote:
> > > >
> > > > multiple sign in pages (per role) would be possible, but not
> > > > supported by default.  you would have to provide the logic and throw
> > > > a differently constructed
> RestartResponseAtInterceptPageException for
> > > > each role.  but it is certainly possible with just a little work.
> > > >
> > > >         jon
> > > >
> > > >
> > > >
> > > >
> -------------------------------------------------------
> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> SPLUNK!
> > > >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> > > > _______________________________________________
> > > > Wicket-develop mailing list
> > > > [email protected]
> > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > >
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> >
> http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
> > _______________________________________________
> > Wicket-develop mailing list
> > [email protected]
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
>
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



Reply via email to