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

Endless recursion if LoadableDetachableModel.load throws exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-M3
    • 1.4.16, 1.5-RC1
    • wicket
    • None

    Description

      I don't know if there's any easy fix for this, but here's what happens:

      1. Component subclass overrides isVisible with a new implementation that depends on the current model state.

      2. The model is a LoadableDetachableModel.

      3. On the initial render, the load method of the LoadableDetachableModel throws a RuntimeException for whatever reason. (In my case I was trying to throw a AbortWithHttpErrorCodeException.)

      4. This gets caught in Component.getDefaultModelObject:

      log.error("Error while getting default model object for Component: " + this.toString(true));

      5. The toString method that's invoked from the exception handler prints the component's state, including its visibility.

      6. In order to resolve the visibility state, toString has to call isVisible--the same method that initially caused the exception.

      7. The isVisible method again throws an exception, etc.

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            wboyce@panix.com Willis Blackburn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: