{"record":{"id":"ebe7be4b4aa1670d","repo":"quarkusio/quarkus","slug":"decorated-interface-decoratedtype-not-found-in","errorCode":null,"errorMessage":"Decorated interface ${decoratedType} not found in the index","messagePattern":"Decorated interface (.+?) not found in the index","errorType":"exception","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanInfo.java","lineNumber":885,"sourceCode":"                addDecoratedMethods(decoratedMethods, interfaceInfo, originalClassInfo, boundDecorators, skipPredicate);\n            }\n        }\n    }\n\n    private record DecoratedMethodCandidate(MethodInfo method, DecorationInfo decoration) {\n    }\n\n    record InterceptedMethodCandidate(MethodInfo method, Set<AnnotationInstance> bindings) {\n    }\n\n    private List<DecoratorMethod> findMatchingDecorators(MethodInfo method, List<DecoratorInfo> decorators) {\n        List<DecoratorMethod> matching = new ArrayList<>(decorators.size());\n        IndexView index = beanDeployment.getBeanArchiveIndex();\n        outermost: for (DecoratorInfo decorator : decorators) {\n            for (Type decoratedType : decorator.getDecoratedTypes()) {\n                ClassInfo decoratedInterface = index.getClassByName(decoratedType.name());\n                if (decoratedInterface == null) {\n                    throw new DefinitionException(\"Decorated interface \" + decoratedType.name() + \" not found in the index\");\n                }\n\n                Map<String, Type> resolvedTypeParameters = Types.resolveDecoratedTypeParams(decoratedInterface, decorator);\n\n                // it's enough to look at methods declared directly on the decorated interface,\n                // because its superinterfaces are present in the set of decorated types\n                for (MethodInfo decoratedMethod : decoratedInterface.methods()) {\n                    if (!method.name().equals(decoratedMethod.name())) {\n                        continue;\n                    }\n                    if (method.parametersCount() != decoratedMethod.parametersCount()) {\n                        continue;\n                    }\n\n                    // Match the resolved parameter types\n                    boolean matches = true;\n                    List<Type> decoratedMethodParams = Types.getResolvedParameters(decoratedInterface, resolvedTypeParameters,\n                            decoratedMethod, index);","sourceCodeStart":867,"sourceCodeEnd":903,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanInfo.java#L867-L903","documentation":"When computing which methods of a decorated interface a decorator must implement, ArC looks up the decorated type in the bean archive index. If the interface class is not in the indexed application classes, this DefinitionException is thrown — the decorator references a type the container cannot see.","triggerScenarios":"A @Decorator declares @Decorates a type that is not part of the indexed bean archive (external/unindexed JAR, generated class, or wrong type referenced), so index.getClassByName returns null in BeanInfo decorator validation.","commonSituations":"Decorator references an interface from a library JAR not indexed by Jandex; the decorated type lives in an unindexed dependency; typo pointing at a class rather than the intended interface.","solutions":["Ensure the JAR containing the decorated interface is indexed by Jandex (add a META-INF/jandex.idx or the quarkus-index-dependency config).","Add the interface to a module/classpath location that gets indexed by the application build.","Verify @Decorates targets the correct interface name/package.","Regenerate the index if the class was recently added (clean build)."],"exampleFix":"// before (unindexed dependency)\n<dependency>\n  <groupId>com.acme</groupId><artifactId>api</artifactId>\n</dependency>\n// after (enable Jandex indexing)\n<dependency>\n  <groupId>com.acme</groupId><artifactId>api</artifactId>\n</dependency>\n<!-- or in quarkus-maven-plugin config -->\n<dependencies>\n  <dependency>com.acme:api</dependency>\n</dependencies>","handlingStrategy":"validation","validationCode":"// Verify the decorated interface is on the application classpath and indexed\nClass<?> decorated = Class.forName(\"com.acme.Api\");\nif (decorated.getPackage().getName().startsWith(\"java.\")) {\n    throw new IllegalStateException(\"Decorated type cannot come from an unindexed/platform package\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure dependencies containing decorated interfaces are Jandex-indexed","Add quarkus.index-dependency entries for external APIs","Run a clean build after adding decorated types"],"tags":["cdi","quarkus-arc","decorator","jandex","index"],"backgroundTag":"class-not-in-bean-archive-index","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"}