quarkusio/quarkus · error · RuntimeException

Failed to find converter for ${elementType}

Error message

Failed to find converter for ${elementType}

What it means

ReflectionConverterIndexerExtension builds converters for element types that require runtime reflection registration (e.g. generic type arguments in resource signatures). For each type it looks for a usable converter such as a static fromString method; if nothing applies it throws RuntimeException because the type cannot be handled for reflection conversion.

Source

Thrown at independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/reflection/ReflectionConverterIndexerExtension.java:68

                    if (fromString != null) {
                        valueOf = null;
                    }
                }
            }
        }
        ParameterConverterSupplier delegate = null;
        if (stringCtor != null) {
            delegate = new ReflectionConstructorParameterConverterSupplier(stringCtor.declaringClass().name().toString());
        } else if (valueOf != null) {
            delegate = new ReflectionValueOfParameterConverterSupplier(valueOf.declaringClass().name().toString());
        } else if (fromString != null) {
            delegate = new ReflectionValueOfParameterConverterSupplier(fromString.declaringClass().name().toString(),
                    "fromString");
        }
        if (hasRuntimeConverters)
            return new RuntimeResolvedConverter.Supplier().setDelegate(delegate);
        if (delegate == null)
            throw new RuntimeException("Failed to find converter for " + elementType);
        return delegate;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add a public static `fromString(String)` (or `valueOf(String)`) method to the type.
  2. Register a jakarta.ws.rs.ext.ParamConverter/ParamConverterProvider for the type.
  3. Use a supported type (wrapper, enum, String) in the resource signature instead.
  4. Adjust reflection indexing configuration if the type does not actually require reflection.

Example fix

// before
class Money { public Money(String v) { ... } }
// after
class Money {
    public Money(String v) { ... }
    public static Money fromString(String v) { return new Money(v); }
}
Defensive patterns

Strategy: validation

Validate before calling

static boolean hasConverter(Class<?> type) {
    try {
        type.getMethod("fromString", String.class);
        return true;
    } catch (NoSuchMethodException ignored) {
        try {
            type.getMethod("valueOf", String.class);
            return true;
        } catch (NoSuchMethodException ignored2) {
            return false;
        }
    }
}

Try / catch

try {
    quarkusBuild();
} catch (RuntimeException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Failed to find converter for")) {
        LOG.error("Add fromString/valueOf or a ParamConverter for: " + e.getMessage(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: A resource method/class references a type in a reflection-indexed position (e.g. generic argument) for which no converter exists — no static fromString/valueOf and no registered runtime converter — during augmentation.

Common situations: Custom types lacking a fromString method used as parameters/generics; third-party library types without String factories; types needing a ParamConverter that was never registered.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/3b88e0c638f299b0. Report an issue: GitHub.