{"record":{"id":"82460efb5d9b6fc3","repo":"quarkusio/quarkus","slug":"unable-to-lookup-configuration-for-rest-client-r","errorCode":null,"errorMessage":"Unable to lookup configuration for REST Client ${restClientInterface}. Please confirm if the REST Client is annotated with @RegisterRestClient","messagePattern":"Unable to lookup configuration for REST Client (.+?)\\. Please confirm if the REST Client is annotated with @RegisterRestClient","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsConfig.java","lineNumber":314,"sourceCode":"    Optional<Boolean> alpn();\n\n    /**\n     * If {@code true}, the stacktrace of the invocation of the REST Client method is captured.\n     * This stacktrace will be used if the invocation throws an exception\n     */\n    @WithDefault(\"false\")\n    boolean captureStacktrace();\n\n    /**\n     * Logging configuration.\n     */\n    RestClientLoggingConfig logging();\n\n    default RestClientConfig getClient(final Class<?> restClientInterface) {\n        if (RestClientKeysProvider.KEYS.contains(restClientInterface.getName())) {\n            return clients().get(restClientInterface.getName());\n        }\n        throw new IllegalArgumentException(\"Unable to lookup configuration for REST Client \" + restClientInterface.getName()\n                + \". Please confirm if the REST Client is annotated with @RegisterRestClient\");\n    }\n\n    interface RestClientLoggingConfig {\n        /**\n         * Scope of logging for the client.\n         * <br/>\n         * WARNING: beware of logging sensitive data\n         * <br/>\n         * The possible values are:\n         * <ul>\n         * <li>{@code request-response} - enables logging request and responses, including redirect responses</li>\n         * <li>{@code all} - enables logging requests and responses and lower-level logging</li>\n         * <li>{@code none} - no additional logging</li>\n         * </ul>\n         *\n         * This property is not applicable to the Quarkus RESTEasy client (provided by the quarkus-resteasy-client dependency).\n         */","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsConfig.java#L296-L332","documentation":"RestClientsConfig.getClient(Class) looks up the per-client configuration by the interface's fully-qualified name in the registered REST client keys. If the interface was never registered as a REST client (i.e. not discovered via @RegisterRestClient at build time), the lookup fails and an IllegalArgumentException is thrown telling the developer to check the annotation.","triggerScenarios":"Injecting/looking up RestClientConfig (or calling config.getClient(SomeInterface.class)) for an interface that lacks @RegisterRestClient, so its name is absent from RestClientKeysProvider.KEYS; also happens when the build-time registration was skipped (wrong package not scanned, annotation processor not applied) or when the class name differs between build and runtime (relocation/shading).","commonSituations":"Forgetting @RegisterRestClient on the interface; referencing the client config by a class from a different module that is not part of the Quarkus app's index; using the programmatic config API for a client configured only via configKey without registration; typos producing a different FQCN than the registered one.","solutions":["Annotate the interface with @RegisterRestClient","Verify the class passed to getClient()/injected is exactly the registered interface (same FQCN), not a similarly-named copy","Ensure the interface is in a package included in the application (indexed by Jandex); add the module/dependency to the app if it lives elsewhere","If configuring via configKey only, use the keyed lookup (clients().get(...)) rather than getClient()"],"exampleFix":"// before\npublic interface MyClient { ... } // no annotation\nRestClientConfig cfg = restClientsConfig.getClient(MyClient.class); // throws\n// after\n@RegisterRestClient(configKey = \"my-client\")\npublic interface MyClient { ... }\nRestClientConfig cfg = restClientsConfig.getClient(MyClient.class);","handlingStrategy":"validation","validationCode":"if (!RestClientKeysProvider.KEYS.contains(iface.getName()))\n    throw new IllegalArgumentException(\"REST client not registered: \" + iface.getName() + \" — missing @RegisterRestClient?\");","typeGuard":null,"tryCatchPattern":"try { RestClientConfig cfg = config.getClient(iface); } catch (IllegalArgumentException e) { log.error(\"Client not registered: {}\", e.getMessage()); }","preventionTips":["Always annotate client interfaces with @RegisterRestClient","Verify the exact FQCN is used for lookups","Ensure client interfaces live in indexed (Jandex) modules","Check registration with a startup test that resolves all injected clients"],"tags":["quarkus","rest-client","configuration","registerrestclient"],"backgroundTag":"unregistered-rest-client","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"}