theonedev/onedev · error · WicketRuntimeException

Exception in rendering component:

Error message

Exception in rendering component: 

What it means

Component.render() catches any RuntimeException thrown during rendering that is not already a WicketRuntimeException and wraps it in a new WicketRuntimeException with the message 'Exception in rendering component: <this>' and the original as the cause. This is a diagnostic wrapper — the real fault is in the cause.

Source

Thrown at server-core/src/main/java/org/apache/wicket/Component.java:2648

				}
				else if (renderBodyOnly == false)
				{
					if (needToRenderTag(openTag))
					{
						// Close the manually opened tag. And since the user might have changed the
						// tag name ...
						getResponse().write(tag.syntheticCloseTagString());
					}
				}
			}
		}
		catch (WicketRuntimeException wre)
		{
			throw wre;
		}
		catch (RuntimeException re)
		{
			throw new WicketRuntimeException("Exception in rendering component: " + this, re);
		}
	}

	/**
	 * 
	 * @param openTag
	 * @return true, if the tag shall be rendered
	 */
	private boolean needToRenderTag(final ComponentTag openTag)
	{
		// If a open-close tag has been modified to be open-body-close then a
		// synthetic close tag must be rendered.
		boolean renderTag = (openTag != null && !(openTag instanceof WicketTag));
		if (renderTag == false)
		{
			renderTag = !getApplication().getMarkupSettings().getStripWicketTags();
		}
		return renderTag;

View on GitHub (pinned to d44925c47c)

Solutions

  1. Inspect the wrapped cause (getCause()) — fix that exception, not the wrapper.
  2. Check the component's model loads null-safely (LoadableDetachableModel.load handling missing data).
  3. Wrap risky rendering logic in try/catch or use IErrorMessageReporter feedback panels.
  4. Log the full stack trace with the component's page path to locate the failing component.
  5. Reproduce with WicketTester to get a tighter stack.

Example fix

// before
protected void onRender() { data.get(0).render(); } // NPE when data empty
// after
protected void onRender() {
    if (data == null || data.isEmpty()) { setVisible(false); return; }
    data.get(0).render();
}
Defensive patterns

Strategy: try-catch

Validate before calling

try { model.getObject(); } catch (RuntimeException e) { log.error("Model load will fail render", e); }

Type guard

boolean safelyRenderable(Component c) { try { return c.getDefaultModel() == null || c.getDefaultModelObject() != null; } catch (RuntimeException e) { return false; } }

Try / catch

try { component.render(); } catch (WicketRuntimeException e) { Throwable cause = e.getCause(); log.error("Real failure rendering " + component.getId(), cause); }

Prevention

When it happens

Trigger: Any RuntimeException thrown from onRender/onComponentRender/onRenderHead, model.getObject() failures during render, NPEs in custom render logic, converter errors — anything thrown inside the component render pipeline.

Common situations: Null model object dereferenced in onBeforeRender; custom panels throwing in their render override; database exceptions during model loading mid-render surfacing wrapped as this error; serialization issues during render.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/63968d67d713a5fe. Report an issue: GitHub.