theonedev/onedev · error · IllegalStateException
has not been properly rendered. Something in the hierarchy
Error message
has not been properly rendered. Something in the hierarchy of
What it means
Before rendering, Component calls onBeforeRender() and then verifies RFLAG_BEFORE_RENDER_SUPER_CALL_VERIFIED, which is only set inside Component.onBeforeRender(). If an override in the class hierarchy fails to call super.onBeforeRender(), Wicket throws this IllegalStateException so state preparation bugs are caught immediately.
Source
Thrown at server-core/src/main/java/org/apache/wicket/Component.java:963
*
*/
private void internalBeforeRender()
{
configure();
if ((determineVisibility()) && !getFlag(FLAG_RENDERING) &&
!getFlag(FLAG_PREPARED_FOR_RENDER))
{
setRequestFlag(RFLAG_BEFORE_RENDER_SUPER_CALL_VERIFIED, false);
getApplication().getComponentPreOnBeforeRenderListeners().onBeforeRender(this);
onBeforeRender();
getApplication().getComponentPostOnBeforeRenderListeners().onBeforeRender(this);
if (!getRequestFlag(RFLAG_BEFORE_RENDER_SUPER_CALL_VERIFIED))
{
throw new IllegalStateException(Component.class.getName() +
" has not been properly rendered. Something in the hierarchy of " +
getClass().getName() +
" has not called super.onBeforeRender() in the override of onBeforeRender() method");
}
}
}
/**
* We need to postpone calling beforeRender() on components that implement {@link IFeedback}, to
* be sure that all other component's beforeRender() has been already called, so that IFeedbacks
* can collect all feedback messages. This is the key under list of postponed {@link IFeedback}
* is stored to request cycle metadata. The List is then iterated over in
* {@link #prepareForRender()} after calling {@link #beforeRender()}, to initialize postponed
* components.
*/
private static final MetaDataKey<List<Component>> FEEDBACK_LIST = new MetaDataKey<List<Component>>()
{
private static final long serialVersionUID = 1L;View on GitHub (pinned to d44925c47c)
Solutions
- Locate the onBeforeRender() override in the class named in the message or an ancestor
- Call super.onBeforeRender() (usually first) in the override
- Check for conditional branches or try/finally that can skip the super call
Example fix
// before
@Override
protected void onBeforeRender() {
if (getModelObject() == null) {
setVisible(false);
}
}
// after
@Override
protected void onBeforeRender() {
super.onBeforeRender();
if (getModelObject() == null) {
setVisible(false);
}
} Defensive patterns
Strategy: validation
Validate before calling
@Override
protected void onBeforeRender() {
super.onBeforeRender();
// your logic here
} Prevention
- Call super.onBeforeRender() first, never conditionally
- Never throw before the super call in onBeforeRender
When it happens
Trigger: An override of onBeforeRender() does not call super.onBeforeRender(), and the component's before-render phase runs during request processing.
Common situations: Components that populate ListItems or set visibility in onBeforeRender(); copied example code or old Wicket 1.x migrations where super calls were optional.
Related errors
- has not been properly detached. Something in the hierarchy
- Cannot determine Markup. Component is not yet connected to a
- has not been properly initialized. Something in the hierarc
- has not been properly added. Something in the hierarchy of
- has not been properly removed from hierachy. Something in t
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/f86b73df4a27061a.
Report an issue: GitHub.