{"record":{"id":"9b52776dae42bf25","repo":"quarkusio/quarkus","slug":"failed-to-find-converter-for-elementtype","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/ServerEndpointIndexer.java","lineNumber":710,"sourceCode":"        // no converter if we have a RestForm mime type: this goes via message body readers in MultipartFormParamExtractor\n        if (getPartMime(annotations) != null)\n            return null;\n        if (elementType.equals(String.class.getName())) {\n            if (hasRuntimeConverters)\n                return new RuntimeResolvedConverter.Supplier().setDelegate(new NoopParameterConverter.Supplier());\n            // String needs no conversion\n            return null;\n        } else if (existingConverters.containsKey(elementType)) {\n            String className = existingConverters.get(elementType);\n            ParameterConverterSupplier delegate;\n            if (className == null)\n                delegate = null;\n            else\n                delegate = new LoadedParameterConverter().setClassName(className);\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        } else if (elementType.equals(PathSegment.class.getName())) {\n            return new PathSegmentParamConverter.Supplier();\n        } else if (elementType.equals(\"char\")) {\n            return new CharParamConverter.Supplier();\n        } else if (elementType.equals(Character.class.getName())) {\n            return new CharacterParamConverter.Supplier();\n        } else if (elementType.equals(FileUpload.class.getName())\n                || elementType.equals(Path.class.getName())\n                || elementType.equals(File.class.getName())\n                || elementType.equals(InputStream.class.getName())\n                || elementType.equals(EntityPart.class.getName())) {\n            // this is handled by MultipartFormParamExtractor\n            return null;\n        } else {\n            DotName typeName = DotName.createSimple(elementType);\n            if (SUPPORT_TEMPORAL_PARAMS.contains(typeName)) {\n                //It might be a LocalDate[Time] object","sourceCodeStart":692,"sourceCodeEnd":728,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/server/processor/src/main/java/org/jboss/resteasy/reactive/server/processor/ServerEndpointIndexer.java#L692-L728","documentation":"During endpoint scanning, ServerEndpointIndexer.extractConverter must produce a ParameterConverter for each JAX-RS parameter type (e.g. @QueryParam/@PathParam values). If the element type has no built-in converter and existingConverters maps it to null (meaning no registered converter exists) and runtime converters are disabled, the deployment fails with 'Failed to find converter'.","triggerScenarios":"A resource method parameter (query, path, header, form, cookie) of a custom type T for which no ParamConverter/Converter class was registered and which is not String, char, PathSegment, temporal, multipart, or otherwise handled. The type previously had a converter indexed, but the map entry value is null and hasRuntimeConverters is false.","commonSituations":"Using a POJO or enum-like custom type as a @QueryParam without registering a ParamConverter; removing a ParamConverterProvider that previously handled the type; running in a mode where runtime converter lookup is disabled (native/generic build) so unindexed types cannot resolve.","solutions":["Implement and register a javax.ws.rs.ext.ParamConverter/ParamConverterProvider for the custom type so it gets indexed at build time","Annotate the parameter type with @ParamConverter (org.jboss.resteasy.reactive) or register the converter via a build-step/extension so it appears in existingConverters","Change the parameter type to String and convert manually inside the method","Enable runtime converters (quarkus.resteasy-reactive.enable-runtime-converter or the relevant @RuntimeConfig use) if the converter is only available at runtime"],"exampleFix":"// before\n@GET\npublic String get(@QueryParam(\"color\") Color color) {...} // no converter\n// after\n@Provider\npublic class ColorParamConverterProvider implements ParamConverterProvider {\n  public <T> ParamConverter<T> getConverter(Class<T> raw, Type generic, Annotation[] anns) {\n    if (raw == Color.class) return (ParamConverter<T>) new ColorParamConverter();\n    return null;\n  }\n}","handlingStrategy":"validation","validationCode":"// Ensure every custom JAX-RS param type has a registered ParamConverter\nSet<Class<?>> used = Set.of(Color.class, Filter.class);\nfor (Class<?> t : used) {\n  boolean hasConverter = converterProviderClasses.stream()\n    .anyMatch(p -> p.getConverter(t, null, new Annotation[0]) != null);\n  if (!hasConverter) throw new IllegalStateException(\"No ParamConverter registered for \" + t.getName());\n}","typeGuard":null,"tryCatchPattern":"try {\n  buildApplication();\n} catch (RuntimeException e) {\n  if (e.getMessage().startsWith(\"Failed to find converter for \")) {\n    String type = e.getMessage().substring(\"Failed to find converter for \".length());\n    log.error(\"Register a ParamConverter/ParamConverterProvider for \" + type);\n  }\n  throw e;\n}","preventionTips":["Register a ParamConverterProvider for every custom type used as a JAX-RS parameter","Keep converters build-time indexable (don't rely on runtime-only registration in native mode)","Favor String parameters plus manual parsing for rarely-used types","Test custom param types in a startup test so deployment fails fast in CI"],"tags":["quarkus","resteasy-reactive","param-converter","deployment-time"],"backgroundTag":"missing-param-converter","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}