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.