{"record":{"id":"aa224a2b94a9d80d","repo":"quarkusio/quarkus","slug":"injectable-beans-are-not-supported-in-client","errorCode":null,"errorMessage":"Injectable beans are not supported in client","messagePattern":"Injectable beans are not supported in client","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/scanning/ClientEndpointIndexer.java","lineNumber":154,"sourceCode":"            methodParameters[i] = clientBeanParamInfo;\n\n        } else {\n            methodParameters[i] = parseClientBeanParam(beanParamClassInfo, index);\n        }\n\n        return false;\n    }\n\n    private MethodParameter parseClientBeanParam(ClassInfo beanParamClassInfo, IndexView index) {\n        List<Item> items = BeanParamParser.parse(beanParamClassInfo, index);\n        return new ClientBeanParamInfo(items, beanParamClassInfo.name().toString());\n    }\n\n    @Override\n    protected InjectableBean scanInjectableBean(ClassInfo currentClassInfo, ClassInfo actualEndpointInfo,\n            Map<String, String> existingConverters, AdditionalReaders additionalReaders,\n            Map<String, InjectableBean> injectableBeans, boolean hasRuntimeConverters) {\n        throw new RuntimeException(\"Injectable beans are not supported in client\");\n    }\n\n    @Override\n    protected MethodParameter createMethodParameter(ClassInfo currentClassInfo, ClassInfo actualEndpointInfo, boolean encoded,\n            Type paramType, ClientIndexedParam parameterResult, String name, String defaultValue, ParameterType type,\n            String elementType, boolean single, String signature,\n            Set<String> fileFormNames) {\n        DeclaredTypes declaredTypes = getDeclaredTypes(paramType, currentClassInfo, actualEndpointInfo);\n        String mimePart = getPartMime(parameterResult.getAnns());\n        String partFileName = getPartFileName(parameterResult.getAnns());\n        String separator = getSeparator(parameterResult.getAnns());\n        return new MethodParameter(name,\n                elementType, declaredTypes.getDeclaredType(), declaredTypes.getDeclaredUnresolvedType(), signature, type,\n                single,\n                defaultValue, parameterResult.isObtainedAsCollection(), parameterResult.isOptional(), encoded,\n                mimePart, partFileName, separator);\n    }\n","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/processor/src/main/java/org/jboss/resteasy/reactive/client/processor/scanning/ClientEndpointIndexer.java#L136-L172","documentation":"ClientEndpointIndexer.scanInjectableBean unconditionally throws: CDI injectable beans (server-side @Inject-driven endpoint classes resolved via CDI) are not supported by the REST Client processor. The client builds proxies at build time from interfaces and cannot scan/resolve injectable bean hierarchies that the server-side indexer supports.","triggerScenarios":"Building a REST client from a class hierarchy where the endpoint resolution path requires scanning an injectable bean — e.g. referencing a @ApplicationScoped/@RequestScoped bean class in a context meant for client proxy generation, or an interface hierarchy extending one that the indexer treats as an injectable bean.","commonSituations":"Sharing a base resource class between server and client and letting the client indexer walk into the CDI-backed server class; misconfiguring a client @RegisterRestClient target to point at a bean class rather than an interface.","solutions":["Ensure @RegisterRestClient is applied to an interface, and the client interface does not extend/invoke the server's CDI bean implementation class.","Extract the shared contract into a plain interface used by both the server bean and the client proxy.","Remove any dependency on runtime CDI injection of the client proxy — clients are built from static interface metadata.","If this arises from a framework hook you overrode/extended, do not reuse server indexer subclasses for client processing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Clients must be interfaces\nif (!clientType.isInterface()) {\n  throw new IllegalArgumentException(\"@RegisterRestClient target must be an interface: \" + clientType);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply @RegisterRestClient only to interfaces","Keep CDI bean implementation classes out of the client interface hierarchy","Extract shared contracts into plain interfaces"],"tags":["rest-client","cdi","build-time","unsupported"],"backgroundTag":"unsupported-cdi-injection","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"}