quarkusio/quarkus · error · IllegalArgumentException
Does not support fromString
Error message
Does not support fromString
What it means
ObjectToStringDelegate is the fallback HeaderDelegate that only supports converting objects to strings. Its fromString throws this IllegalArgumentException unconditionally for any non-null input because deserializing an arbitrary object from a header string is not supported. Reaching it means a header value type has no real parsing delegate registered.
Source
Thrown at independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/headers/ObjectToStringDelegate.java:14
package org.jboss.resteasy.reactive.common.headers;
import java.util.Objects;
import jakarta.ws.rs.ext.RuntimeDelegate;
public class ObjectToStringDelegate implements RuntimeDelegate.HeaderDelegate<Object> {
public static final ObjectToStringDelegate INSTANCE = new ObjectToStringDelegate();
@Override
public Object fromString(String value) {
if (value == null)
throw new IllegalArgumentException("Param was null");
throw new IllegalArgumentException("Does not support fromString");
}
@Override
public String toString(Object value) {
if (value == null)
throw new IllegalArgumentException("Param was null");
return Objects.toString(value);
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Implement and register a HeaderDelegate<YourType> with a real fromString, or use a natively supported type (String, MediaType, NewCookie, Date, etc.).
- Parse the raw string yourself before constructing the typed header object.
- Restrict header types to ones with built-in delegates if you rely on automatic conversion.
Example fix
// before
MyEnum v = (MyEnum) delegate.fromString("VALUE_ONE"); // ObjectToStringDelegate: always throws
// after
MyEnum v = MyEnum.valueOf("VALUE_ONE"); // parse with a type-aware path or register a HeaderDelegate Defensive patterns
Strategy: try-catch
Validate before calling
// ObjectToStringDelegate.fromString never succeeds for non-null input;
// check the type is parseable before relying on RuntimeDelegate conversion
if (!isStringLike(headerValue.getClass())) {
throw new UnsupportedOperationException("Provide a HeaderDelegate for " + headerValue.getClass());
} Try / catch
try {
return delegate.fromString(raw);
} catch (IllegalArgumentException e) {
if ("Does not support fromString".equals(e.getMessage())) {
return parseManually(raw); // custom parsing path
}
throw e;
} Prevention
- Implement HeaderDelegate<T> for any custom header type used with automatic conversion.
- Keep header generic types concrete (avoid Object) so the fallback delegate is never selected.
- Document which header types are round-trippable in your API.
- Add an architecture test asserting no Object-typed header conversions exist.
When it happens
Trigger: Calling ObjectToStringDelegate.INSTANCE.fromString(anyString), or RuntimeDelegate-based header conversion where the target type falls back to ObjectToStringDelegate (custom header class without a registered HeaderDelegate).
Common situations: Custom typed headers (enums, value objects) passed to frameworks that must parse incoming header strings; migration after removing a HeaderDelegate registration; using Object as the header generic type.
Related errors
- Param was null
- retrieving all roles not supported when JAX-RS security cont
- retrieving all roles not supported when JAX-RS security cont
- Media type was null
- param was null
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/fd022c8e04f0efa9.
Report an issue: GitHub.