{"record":{"id":"786cc8183d2e4de8","repo":"quarkusio/quarkus","slug":"the-decorator-decoratorclass-has-no-decorated-t","errorCode":null,"errorMessage":"The decorator ${decoratorClass} has no decorated type","messagePattern":"The decorator (.+?) has no decorated type","errorType":"exception","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Decorators.java","lineNumber":86,"sourceCode":"                        \"A decorator must be @Dependent but \" + decoratorClass + \" declares \" + scopeAnnotation.getDotName());\n            }\n        }\n\n        //  The set includes all bean types which are Java interfaces, except for java.io.Serializable\n        TypeClosure typeClosure = Types.getClassBeanTypeClosure(decoratorClass, beanDeployment);\n        Set<Type> types = typeClosure.types();\n        Set<Type> decoratedTypes = new HashSet<>();\n        for (Type type : types) {\n            if (type.name().equals(DotNames.SERIALIZABLE)) {\n                continue;\n            }\n            ClassInfo clazz = beanDeployment.getBeanArchiveIndex().getClassByName(type.name());\n            if (Modifier.isInterface(clazz.flags())) {\n                decoratedTypes.add(type);\n            }\n        }\n        if (decoratedTypes.isEmpty()) {\n            throw new DefinitionException(\"The decorator \" + decoratorClass + \" has no decorated type\");\n        }\n\n        // The delegate type of a decorator must implement or extend every decorated type\n        Set<Type> delegateTypes = Types.getDelegateTypeClosure(delegateInjectionPoint, beanDeployment);\n        for (Type decoratedType : decoratedTypes) {\n            if (!delegateTypes.contains(decoratedType)) {\n                throw new DefinitionException(\"The delegate type \" + delegateInjectionPoint.getRequiredType()\n                        + \" does not implement the decorated type: \" + decoratedType);\n            }\n            for (BuiltinBean bean : BuiltinBean.values()) {\n                if (bean.equals(BuiltinBean.RESOURCE)) {\n                    // do not take Resource into consideration\n                    continue;\n                }\n                if (bean.hasRawTypeDotName(decoratedType.name())) {\n                    throw new UnsupportedOperationException(\"Decorating built-in bean types is not supported! \" +\n                            \"Decorator \" + decoratorClass + \" is attempting to decorate \" + decoratedType.name());\n                }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Decorators.java#L68-L104","documentation":"A bean annotated @Decorator must declare at least one @Delegate injection point whose type is an interface also listed among the decorator's decorated types. Arc's Decorators.createDecorator collects the decorator's interface types as decorated types; if none resolve (no interfaces, or only classes), no decorated type exists and deployment fails with this DefinitionException.","triggerScenarios":"Registering a class as a @Decorator that implements no interface, or whose @Delegate injection point type matches none of its interfaces, so the decoratedTypes set stays empty in createDecorator.","commonSituations":"Forgetting to implement any interface on the decorator; @Delegate pointing at a concrete class type; typos in generics; a refactor removing the implemented interface; moving the decorator to a bean archive where the interface is not indexed.","solutions":["Make the decorator class implement at least one interface and give it a @Delegate field of that interface type.","Ensure the @Delegate injection point's required type matches (implements/extends) the interface being decorated.","Verify the interface and decorator are in an indexed bean archive and not excluded by discovery filters.","Rebuild after refactors so the Jandex index reflects the current class hierarchy."],"exampleFix":"// before\n@Decorator\npublic class TracedService {\n    @Delegate\n    Service service; // no interface implemented\n}\n\n// after\n@Decorator\npublic class TracedService implements Service {\n    @Delegate\n    Service delegate;\n}","handlingStrategy":"validation","validationCode":"if (!java.lang.reflect.Modifier.isInterface(Decorator.class.getInterfaces().length > 0 ? Decorator.class.getInterfaces()[0].getModifiers() : 0) || Decorator.class.getInterfaces().length == 0) throw new IllegalStateException(\"@Decorator must implement at least one interface\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair @Decorator with 'implements SomeInterface' and a @Delegate field of that interface.","Write an ArchUnit/architecture test asserting every @Decorator class has interfaces and a @Delegate member.","Rebuild the Jandex index after interface refactors."],"tags":["cdi","decorator","quarkus-arc","deployment-time"],"backgroundTag":"decorator-missing-decorated-type","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"}