theonedev/onedev · warning · IllegalStateException

Markup id set on a component that is usually not rendered in

Error message

Markup id set on a component that is usually not rendered into markup. Markup id: %s, component id: %s, component tag: %s.

What it means

When a component that normally contributes no markup (e.g. a Border's body or transparent resolver components) gets a markup id requested during render, Wicket warns and, if ExceptionSettings.NotRenderableErrorStrategy is THROW_EXCEPTION, throws IllegalStateException with the markup id, component id and tag name. It signals a request for an HTML id attribute on a component that will never be written to the response.

Source

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

			if ((tag instanceof WicketTag) && !tag.isClose() &&
				!getFlag(FLAG_IGNORE_ATTRIBUTE_MODIFIER))
			{
				ExceptionSettings.NotRenderableErrorStrategy notRenderableErrorStrategy = ExceptionSettings.NotRenderableErrorStrategy.LOG_WARNING;
				if (Application.exists())
				{
					notRenderableErrorStrategy = getApplication().getExceptionSettings().getNotRenderableErrorStrategy();
				}

				String tagName = tag.getNamespace() + ":" + tag.getName();
				String componentId = getId();
				if (getFlag(FLAG_OUTPUT_MARKUP_ID))
				{
					String message = String.format("Markup id set on a component that is usually not rendered into markup. " +
					                               "Markup id: %s, component id: %s, component tag: %s.",
					                               getMarkupId(), componentId, tagName);
					if (notRenderableErrorStrategy == ExceptionSettings.NotRenderableErrorStrategy.THROW_EXCEPTION)
					{
						throw new IllegalStateException(message);
					}
					log.warn(message);
				}
				if (getFlag(FLAG_PLACEHOLDER))
				{
					String message = String.format(
							"Placeholder tag set on a component that is usually not rendered into markup. " +
							"Component id: %s, component tag: %s.", componentId, tagName);
					if (notRenderableErrorStrategy == ExceptionSettings.NotRenderableErrorStrategy.THROW_EXCEPTION)
					{
						throw new IllegalStateException(message);
					}
					log.warn(message);
				}
			}

			// Write the tag
			tag.writeOutput(getResponse(), !needToRenderTag(null),

View on GitHub (pinned to d44925c47c)

Solutions

  1. Remove setOutputMarkupId(true)/markup-id usage from the non-renderable component, or move it to a renderable parent container.
  2. Wrap the component in a WebMarkupContainer that is rendered and set the markup id on the container.
  3. Switch ExceptionSettings.NotRenderableErrorStrategy to LOG_WARNING if the warning is acceptable.

Example fix

// before
Label hidden = new Label("x", "v");
hidden.setOutputMarkupId(true); // not rendered into markup
border.add(hidden);
// after
WebMarkupContainer wrap = new WebMarkupContainer("x");
wrap.setOutputMarkupId(true);
wrap.add(new Label("inner", "v"));
border.add(wrap);
Defensive patterns

Strategy: validation

Validate before calling

if (!component.isVisibleInHierarchy() || component instanceof Border.BorderBodyContainer) {
    // do not setOutputMarkupId on non-renderable components
}

Try / catch

try { component.getMarkupId(); } catch (IllegalStateException e) { component = wrapInContainer(component); }

Prevention

When it happens

Trigger: Calling setOutputMarkupId(true)/getMarkupId() on a component that is not rendered into markup (e.g. inside a transparent markup resolver or a Border body), with NotRenderableErrorStrategy set to THROW_EXCEPTION.

Common situations: Applications enabling strict not-renderable strategy in ExceptionSettings; AJAX-updating components that turn out to be non-renderable; misuse of setOutputMarkupId(true) inside borders.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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