{"record":{"id":"de85a8e4fc4a01c2","repo":"quarkusio/quarkus","slug":"failed-to-generate-client-for-class-clazz","errorCode":null,"errorMessage":"Failed to generate client for class \" + clazz + \" : \" + failure","messagePattern":"Failed to generate client for class \" \\+ clazz \\+ \" : \" \\+ failure","errorType":"exception","errorClass":"InvalidRestClientDefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientProxies.java","lineNumber":31,"sourceCode":"import org.jboss.resteasy.reactive.client.api.InvalidRestClientDefinitionException;\n\npublic class ClientProxies {\n\n    final Map<Class<?>, BiFunction<WebTarget, List<ParamConverterProvider>, ?>> clientProxies;\n    private final Map<Class<?>, String> failures;\n\n    public ClientProxies(Map<Class<?>, BiFunction<WebTarget, List<ParamConverterProvider>, ?>> clientProxies,\n            Map<Class<?>, String> failures) {\n        this.clientProxies = clientProxies;\n        this.failures = failures;\n    }\n\n    public <T> T get(Class<?> clazz, WebTarget webTarget, List<ParamConverterProvider> providers) {\n        BiFunction<WebTarget, List<ParamConverterProvider>, ?> function = clientProxies.get(clazz);\n        if (function == null) {\n            String failure = failures.get(clazz);\n            if (failure != null) {\n                throw new InvalidRestClientDefinitionException(\n                        \"Failed to generate client for class \" + clazz + \" : \" + failure);\n            } else {\n                if (hasRestClientAnnotations(clazz)) {\n                    throw new IllegalStateException(\"REST client interface: \" + clazz\n                            + \" was not indexed at build time. See https://quarkus.io/guides/cdi-reference#bean_discovery for information on how to index the module that contains it.\");\n                } else {\n                    throw new IllegalArgumentException(\"Not a REST client interface: \" + clazz + \". No @Path annotation \" +\n                            \"found on the class or any methods of the interface and no HTTP method annotations \" +\n                            \"(@POST, @PUT, @GET, @HEAD, @DELETE, etc) found on any of the methods\");\n                }\n            }\n        }\n        //noinspection unchecked\n        return (T) function.apply(webTarget, providers);\n    }\n\n    private boolean hasRestClientAnnotations(Class<?> clazz) {\n        for (Annotation annotation : clazz.getAnnotations()) {","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientProxies.java#L13-L49","documentation":"A runtime REST client proxy could not be created for the requested interface because its build-time generation recorded a failure. ClientProxies.get() looks up the generated proxy BiFunction; when absent but a per-class failure message exists, it throws InvalidRestClientDefinitionException carrying that build-time reason (e.g. invalid @Path/@RegisterRestClient configuration or unresolvable annotations).","triggerScenarios":"Injecting or calling QuarkusRestClientBuilder/ClientProxies.get() for an interface whose proxy generation failed during the build; a @RegisterRestClient interface with invalid annotations or configuration that the build-time processor recorded as failed.","commonSituations":"Malformed @Path or @RegisterRestClient config keys; unsupported method signatures (missing @Produces/@Consumes, generics the generator cannot handle); the error message's `failure` suffix names the exact build-time cause — read it.","solutions":["Read the `: <failure>` suffix of the message — it states the exact build-time generation problem","Fix the offending annotation/config on the client interface (Path expressions, HTTP method annotations, parameter types)","Rebuild the application so the client proxy regenerates cleanly","If the interface is not meant to be a REST client, remove the REST client annotations — the failure map only covers annotated interfaces"],"exampleFix":"// before (invalid path template)\n@Path(\"/items/{id\")\npublic interface ItemClient { @GET Item get(@PathParam(\"id\") String id); }\n\n// after\n@Path(\"/items/{id}\")\npublic interface ItemClient { @GET Item get(@PathParam(\"id\") String id); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    MyClient c = QuarkusRestClientBuilder.newBuilder().build(MyClient.class);\n} catch (InvalidRestClientDefinitionException e) {\n    log.error(\"Client generation failed: \" + e.getMessage(), e); // read the failure suffix\n    throw e;\n}","preventionTips":["Read the `: <failure>` suffix — it names the exact build-time cause","Fix invalid annotations/config on the client interface and rebuild","Add a startup smoke test that builds every REST client interface","Keep client interfaces simple: valid @Path templates, supported parameter/return types"],"tags":["rest-client","build-time","proxy-generation","configuration"],"backgroundTag":"rest-client-proxy-generation-failed","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"}