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

PageExpiredException still thrown after handled by IRequestCycleListener

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC7
    • Fix Version/s: 1.5.1
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Wicket version: 1.5-RC7
      java version "1.6.0_25"
      Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
      Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)

      Description

      In the attached quickstart, a simple AJAX form expires.
      After expiry, the user clicks a button and a PageExpiredException is thrown.

      onException() of an IRequestCycleListener handles it, but the framework still throws it so the handling of it does not work.

      It appears this is caused by getRequestLoggerSettings().setRequestLoggerEnabled(true); but I am not sure.

      This works fine in 1.4

      1. quickstart.zip
        10 kB
        bernard
      2. testcase1.4.zip
        8 kB
        bernard

        Activity

        Hide
        mgrigorov Martin Grigorov added a comment -

        try/catch the logger message generation, log a warning if there a problem and return "UNKNOWN" as result.
        Example: event=

        {handler=ListenerInterfaceRequestHandler,pageClass=UNKNOWN}
        Show
        mgrigorov Martin Grigorov added a comment - try/catch the logger message generation, log a warning if there a problem and return "UNKNOWN" as result. Example: event= {handler=ListenerInterfaceRequestHandler,pageClass=UNKNOWN}
        Hide
        svenmeier Sven Meier added a comment -

        Maybe I didn't understand the problem correctly, but isn't this just a matter of catching PageExpiredException in RequestLogger#getListenerString) ?

        Show
        svenmeier Sven Meier added a comment - Maybe I didn't understand the problem correctly, but isn't this just a matter of catching PageExpiredException in RequestLogger#getListenerString) ?
        Hide
        bht@actrix.gen.nz bernard added a comment -

        Added a testcase for 1.4. RequestLogger entry is:

        INFO: time=11562,event=null,response=PageRequest[org.apache.wicket.markup.html.pages.PageExpiredErrorPage(0)],sessionid=null,sessionsize=1086,activerequests=0,maxmem=518M,total=179M,used=93M

        I think the reason for the difference could be that I found it easier in 1.4 to intercept PageExpiredException in WebRequestCycleProcessor#resolve(...).

        Is that possible in 1.5, too?

        Many thanks.

        Show
        bht@actrix.gen.nz bernard added a comment - Added a testcase for 1.4. RequestLogger entry is: INFO: time=11562,event=null,response=PageRequest [org.apache.wicket.markup.html.pages.PageExpiredErrorPage(0)] ,sessionid=null,sessionsize=1086,activerequests=0,maxmem=518M,total=179M,used=93M I think the reason for the difference could be that I found it easier in 1.4 to intercept PageExpiredException in WebRequestCycleProcessor#resolve(...). Is that possible in 1.5, too? Many thanks.
        Hide
        mgrigorov Martin Grigorov added a comment -

        What is the behavior of RequestLogger with PageExpiredException in 1.4 ? What does it logs for this request ?
        Please attach similar quickstart for 1.4 so I can see what is the difference.

        RequestLogger runs at the very end of the request cycle processing. The best we can do is to try/catch the request logger. It shouldn't break the request processing.

        Show
        mgrigorov Martin Grigorov added a comment - What is the behavior of RequestLogger with PageExpiredException in 1.4 ? What does it logs for this request ? Please attach similar quickstart for 1.4 so I can see what is the difference. RequestLogger runs at the very end of the request cycle processing. The best we can do is to try/catch the request logger. It shouldn't break the request processing.
        Hide
        bht@actrix.gen.nz bernard added a comment -

        Hi Martin, thanks for evaluating.

        Why is using RequestLogger a problem since 1.5? It wasn't in 1.4.

        Why is this issue considered not a problem? For me it is. Page expiry is a big issue for users who are logged in invisibly by remember-me cookie. I really need to trace this, and in development mode, I have RequestLogger on all the time so I see things in context.

        Can RequestLogger be fixed to handle the PageExpiredException? That would sound logical to me.

        Show
        bht@actrix.gen.nz bernard added a comment - Hi Martin, thanks for evaluating. Why is using RequestLogger a problem since 1.5? It wasn't in 1.4. Why is this issue considered not a problem? For me it is. Page expiry is a big issue for users who are logged in invisibly by remember-me cookie. I really need to trace this, and in development mode, I have RequestLogger on all the time so I see things in context. Can RequestLogger be fixed to handle the PageExpiredException? That would sound logical to me.
        Hide
        mgrigorov Martin Grigorov added a comment -

        It is still possible.
        The problem is that you use RequestLogger. It is executed at the end of the request and it tries to extract the page information, particularly its class, while having just its id, so it throws a new PageExpiredException which is too late to be handled.

        Show
        mgrigorov Martin Grigorov added a comment - It is still possible. The problem is that you use RequestLogger. It is executed at the end of the request and it tries to extract the page information, particularly its class, while having just its id, so it throws a new PageExpiredException which is too late to be handled.
        Hide
        bht@actrix.gen.nz bernard added a comment -

        Testcase

        Show
        bht@actrix.gen.nz bernard added a comment - Testcase

          People

          • Assignee:
            mgrigorov Martin Grigorov
            Reporter:
            bht@actrix.gen.nz bernard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development