theonedev/onedev · error · IllegalStateException

has not been properly initialized. Something in the hierarc

Error message

 has not been properly initialized. Something in the hierarchy of 

What it means

Wicket's Component.initialize() calls onInitialize() and then verifies that the RFLAG_INITIALIZE_SUPER_CALL_VERIFIED flag was set. That flag is only set inside Component.onInitialize(), so if any subclass override of onInitialize() forgot to call super.onInitialize(), the flag stays unset and this IllegalStateException is thrown. It is a framework self-check to catch broken lifecycle overrides before they cause subtle state bugs.

Source

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

	{
		fireInitialize();
	}

	/**
	 * Used to call {@link #onInitialize()}
	 */
	final void fireInitialize()
	{
		HierarchicalContext.push(new HierarchicalContext(new ComponentHierarchical(this)));
		try {
			if (!getFlag(FLAG_INITIALIZED))
			{
				setFlag(FLAG_INITIALIZED, true);
				setRequestFlag(RFLAG_INITIALIZE_SUPER_CALL_VERIFIED, false);
				onInitialize();
				if (!getRequestFlag(RFLAG_INITIALIZE_SUPER_CALL_VERIFIED))
				{
					throw new IllegalStateException(Component.class.getName() +
						" has not been properly initialized. Something in the hierarchy of " +
						getClass().getName() +
						" has not called super.onInitialize() in the override of onInitialize() method");
				}
				setRequestFlag(RFLAG_INITIALIZE_SUPER_CALL_VERIFIED, false);
	
				getApplication().getComponentInitializationListeners().onInitialize(this);
			}
			else if (getFlag(FLAG_REMOVED))
			{
				setFlag(FLAG_REMOVED, false);
				setRequestFlag(RFLAG_ON_RE_ADD_SUPER_CALL_VERIFIED, false);
				onReAdd();
				if (!getRequestFlag(RFLAG_ON_RE_ADD_SUPER_CALL_VERIFIED))
				{
					throw new IllegalStateException(Component.class.getName() +
							" has not been properly added. Something in the hierarchy of " +
							getClass().getName() +

View on GitHub (pinned to d44925c47c)

Solutions

  1. Find the component class named in the message and its superclasses, locate the onInitialize() override
  2. Add super.onInitialize() as the first statement of that override
  3. Rebuild and re-run; if you do not override onInitialize, check parent classes and mixins for the missing super call

Example fix

// before
@Override
protected void onInitialize() {
    setOutputMarkupId(true);
}
// after
@Override
protected void onInitialize() {
    super.onInitialize();
    setOutputMarkupId(true);
}
Defensive patterns

Strategy: validation

Validate before calling

// Before shipping, grep for overrides missing super calls:
// grep -rn "protected void onInitialize()" src/main/java | while read f; do
//   awk '/protected void onInitialize\(\)/,/^    }/' "${f#*:}" | grep -q 'super.onInitialize()' || echo "missing super: $f"
// done

Prevention

When it happens

Trigger: A class in the component hierarchy overrides onInitialize() without calling super.onInitialize(); the component is then attached/initialized during request processing.

Common situations: Custom panels/pages/behaviors written by hand or copied from old Wicket 1.x code (pre-6.x did not enforce super calls); upgrading Wicket versions surfaces previously tolerated overrides.

Related errors


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