theonedev/onedev · error · java.lang.IllegalArgumentException

Internal error. Request string '{string}' not a valid integ

Error message

Internal error.  Request string '{string}' not a valid integer

What it means

FormComponent's internal integer conversion helper (used e.g. for request parameter indices) throws IllegalArgumentException with a message naming the offending string when Integer.parseInt fails. Reaching it means Wicket internals received a non-numeric request string that should have been numeric — effectively an internal invariant violation.

Source

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

	{
		return getDefaultModelObjectAsString();
	}

	/**
	 * Gets the request parameter for this component as an int.
	 * 
	 * @return The value in the request for this component
	 */
	protected final int inputAsInt()
	{
		final String string = getInput();
		try
		{
			return Integer.parseInt(string);
		}
		catch (NumberFormatException e)
		{
			throw new IllegalArgumentException(
				exceptionMessage("Internal error.  Request string '" + string +
					"' not a valid integer"));
		}
	}

	/**
	 * Gets the request parameter for this component as an int, using the given default in case no
	 * corresponding request parameter was found.
	 * 
	 * @param defaultValue
	 *            Default value to return if request does not have an integer for this component
	 * @return The value in the request for this component
	 */
	protected final int inputAsInt(final int defaultValue)
	{
		final String string = getInput();
		if (string != null)
		{

View on GitHub (pinned to d44925c47c)

Solutions

  1. Inspect the '{string}' value in the message to find which parameter is malformed
  2. Check custom request coding / URL mappers that might alter numeric parameters
  3. Reproduce with a clean request to rule out tampering or proxy URL rewriting
  4. Update Wicket version if a known internal conversion bug matches your coding strategy

Example fix

// before
custom encoder writes /page/name-abc where numeric index expected
// after
encode only numeric segments for indexed parameters, e.g. /page/3
Defensive patterns

Strategy: try-catch

Type guard

boolean isNumeric = s != null && s.matches("\\d+");

Try / catch

try {
    parseRequestIndex(param);
} catch (IllegalArgumentException e) {
    log.warn("Non-numeric request parameter: {}", e.getMessage());
    // reject or sanitize the request
}

Prevention

When it happens

Trigger: A request parameter or rendered index string that Wicket expects to be an integer contains non-numeric content (corrupted/tampered request, malformed generated markup id/index, custom request coding mangling parameters).

Common situations: Custom IRequestCodingStrategy/URL mappers producing non-numeric segments where default coding expects indices; proxies or scripts rewriting request strings; corrupted bookmarkable/stateless URLs.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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