{"record":{"id":"9836a651032926db","repo":"quarkusio/quarkus","slug":"not-a-rest-client-interface-clazz-no-pa","errorCode":null,"errorMessage":"Not a REST client interface: \" + clazz + \". No @Path annotation found on the class or any methods of the interface and no HTTP method annotations (@POST, @PUT, @GET, @HEAD, @DELETE, etc) found on any of the methods","messagePattern":"Not a REST client interface: \" \\+ clazz \\+ \"\\. No @Path annotation found on the class or any methods of the interface and no HTTP method annotations \\(@POST, @PUT, @GET, @HEAD, @DELETE, etc\\) found on any of the methods","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/ClientProxies.java","lineNumber":38,"sourceCode":"    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()) {\n            if (isRestClientAnnotation(annotation)) {\n                return true;\n            }\n        }\n        for (Method method : clazz.getDeclaredMethods()) {\n            for (Annotation annotation : method.getDeclaredAnnotations()) {\n                if (isRestClientAnnotation(annotation)) {","sourceCodeStart":20,"sourceCodeEnd":56,"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#L20-L56","documentation":"The requested class has no generated client proxy and carries no REST client annotations at all, so it cannot be a REST client interface. ClientProxies.get() falls through to this IllegalArgumentException when the interface lacks @Path on itself or its methods and lacks any HTTP method annotation (@GET, @POST, @PUT, @HEAD, @DELETE, etc.).","triggerScenarios":"Passing a plain (unannotated) interface or class to QuarkusRestClientBuilder/ClientProxies.get() expecting a proxy to be created.","commonSituations":"Mistakenly registering the wrong interface (e.g. the API model class instead of the client); forgetting @Path or the @GET/@POST annotations on interface methods; refactor moved annotations off the interface; typos in package imports (wrong @Path).","solutions":["Annotate the interface with @Path (class or method level) and each method with an HTTP method annotation (@GET/@POST/@PUT/@DELETE/@HEAD)","Verify you are passing the actual REST client interface, not a DTO/model interface","Add @RegisterRestClient if using MicroProfile REST client configuration","Rebuild after adding annotations so the build-time proxy generation picks it up"],"exampleFix":"// before\npublic interface ItemClient { Item get(String id); }\n\n// after\n@Path(\"/items\")\n@RegisterRestClient\npublic interface ItemClient {\n    @GET\n    @Path(\"/{id}\")\n    Item get(@PathParam(\"id\") String id);\n}","handlingStrategy":"validation","validationCode":"// verify the interface is a valid REST client before building\nstatic boolean isRestClientInterface(Class<?> c) {\n    if (!c.isInterface()) return false;\n    if (c.isAnnotationPresent(jakarta.ws.rs.Path.class)) return true;\n    for (Method m : c.getMethods()) {\n        if (m.isAnnotationPresent(jakarta.ws.rs.Path.class)) return true;\n        for (Annotation a : m.getAnnotations())\n            if (a.annotationType().getName().startsWith(\"jakarta.ws.rs.\")) return true;\n    }\n    return false;\n}","typeGuard":"boolean isValidRestClient(Class<?> c) { return c.isInterface() && isRestClientInterface(c); }","tryCatchPattern":"try {\n    return builder.build(clazz);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Not a REST client interface\")) {\n        throw new ConfigurationException(\"Register the annotated client interface, not \" + clazz, e);\n    }\n    throw e;\n}","preventionTips":["Annotate the interface with @Path and methods with @GET/@POST/etc. before registering it","Double-check you pass the client interface, not a DTO or model class","Add @RegisterRestClient for MicroProfile-style configuration","Cover every client interface with a startup build test"],"tags":["rest-client","annotations","missing-annotation","proxy-generation"],"backgroundTag":"not-a-rest-client-interface","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"}