theonedev/onedev · error · org.apache.wicket.WicketRuntimeException

An error occurred while trying to set the collection attache

Error message

An error occurred while trying to set the collection attached to {formComponent}

What it means

When applying converted multi-select input, Wicket tries to set the collection on the component's model; if the model object rejects modification and has no usable setter, the failure is thrown as this WicketRuntimeException naming the form component.

Source

Thrown at server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java:1713

			catch (UnsupportedOperationException unmodifiable)
			{
				if (logger.isDebugEnabled())
				{
					logger.debug("An error occurred while trying to modify the collection attached to "
							+ formComponent, unmodifiable);
				}
				collection = new ArrayList<>(convertedInput); 
			}
			
			try
			{
				formComponent.getModel().setObject(collection);
			}
			catch (Exception noSetter)
			{
				if (!modified)
				{
					throw new WicketRuntimeException("An error occurred while trying to set the collection attached to "
							+ formComponent, noSetter);
				}
				else if (logger.isDebugEnabled())
				{
					logger.debug("An error occurred while trying to set the collection attached to "
							+ formComponent, noSetter);
				}
			}
			
			formComponent.modelChanged();
		}
	}
}

View on GitHub (pinned to d44925c47c)

Solutions

  1. Use a mutable collection type in the component's model.
  2. Provide a working setter on the model object, or replace the model with a settable property.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java:1713 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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