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
- Remove setOutputMarkupId(true)/markup-id usage from the non-renderable component, or move it to a renderable parent container.
- Wrap the component in a WebMarkupContainer that is rendered and set the markup id on the container.
- 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
- Only call setOutputMarkupId(true) on components that render their own tag.
- Set NotRenderableErrorStrategy to LOG_WARNING unless strict checking is needed.
- Wrap border-body or transparent-resolver content in a WebMarkupContainer when AJAX updates are required.
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
- Markup not found for Component:
- Markup not found. Component:
- Placeholder tag set on a component that is usually not rende
- Path '${mountPath}' should be mounted to a svg sprite resour
- Cannot determine Markup. Component is not yet connected to a
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/0db2d9228fdb4d95.
Report an issue: GitHub.