{"record":{"id":"3b88e0c638f299b0","repo":"quarkusio/quarkus","slug":"failed-to-find-converter-for-elementtype-3b88e0","errorCode":null,"errorMessage":"Failed to find converter for ${elementType}","messagePattern":"Failed to find converter for (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/reflection/ReflectionConverterIndexerExtension.java","lineNumber":68,"sourceCode":"                    if (fromString != null) {\n                        valueOf = null;\n                    }\n                }\n            }\n        }\n        ParameterConverterSupplier delegate = null;\n        if (stringCtor != null) {\n            delegate = new ReflectionConstructorParameterConverterSupplier(stringCtor.declaringClass().name().toString());\n        } else if (valueOf != null) {\n            delegate = new ReflectionValueOfParameterConverterSupplier(valueOf.declaringClass().name().toString());\n        } else if (fromString != null) {\n            delegate = new ReflectionValueOfParameterConverterSupplier(fromString.declaringClass().name().toString(),\n                    \"fromString\");\n        }\n        if (hasRuntimeConverters)\n            return new RuntimeResolvedConverter.Supplier().setDelegate(delegate);\n        if (delegate == null)\n            throw new RuntimeException(\"Failed to find converter for \" + elementType);\n        return delegate;\n    }\n}\n","sourceCodeStart":50,"sourceCodeEnd":72,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/reflection/ReflectionConverterIndexerExtension.java#L50-L72","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a public static `fromString(String)` (or `valueOf(String)`) method to the type.","Register a jakarta.ws.rs.ext.ParamConverter/ParamConverterProvider for the type.","Use a supported type (wrapper, enum, String) in the resource signature instead.","Adjust reflection indexing configuration if the type does not actually require reflection."],"exampleFix":"// before\nclass Money { public Money(String v) { ... } }\n// after\nclass Money {\n    public Money(String v) { ... }\n    public static Money fromString(String v) { return new Money(v); }\n}","handlingStrategy":"validation","validationCode":"static boolean hasConverter(Class<?> type) {\n    try {\n        type.getMethod(\"fromString\", String.class);\n        return true;\n    } catch (NoSuchMethodException ignored) {\n        try {\n            type.getMethod(\"valueOf\", String.class);\n            return true;\n        } catch (NoSuchMethodException ignored2) {\n            return false;\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    quarkusBuild();\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Failed to find converter for\")) {\n        LOG.error(\"Add fromString/valueOf or a ParamConverter for: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Give custom parameter types a public static fromString(String).","Register ParamConverterProviders for third-party types.","Prefer enums/primitives/wrappers for path/query parameters.","Avoid exotic generic types in resource signatures unless reflection is required."],"tags":["quarkus","resteasy-reactive","build-time","reflection","converter"],"backgroundTag":"missing-converter","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}