{"record":{"id":"94bb3e420574ec92","repo":"quarkusio/quarkus","slug":"unable-to-construct-type-for-decorator-e-get","errorCode":null,"errorMessage":"Unable to construct type for ${decorator}: ${e.getMessage()}","messagePattern":"Unable to construct type for (.+?): (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DecoratorGenerator.java","lineNumber":203,"sourceCode":"                        for (AnnotationInstance delegateQualifier : decorator.getDelegateQualifiers()) {\n                            ClassInfo delegateQualifierClass = decorator.getDeployment()\n                                    .getQualifier(delegateQualifier.name());\n                            bc.withSet(delegateQualifiers).add(\n                                    annotationLiterals.create(bc, delegateQualifierClass, delegateQualifier));\n                        }\n                        bc.set(cc.this_().field(delegateQualifiersField), delegateQualifiers);\n\n                    }\n\n                    LocalVar tccl = bc.localVar(\"tccl\", bc.invokeVirtual(MethodDescs.THREAD_GET_TCCL, bc.currentThread()));\n                    RuntimeTypeCreator rttc = RuntimeTypeCreator.of(bc).withTCCL(tccl);\n\n                    LocalVar decoratedTypes = bc.localVar(\"decoratedTypes\", bc.new_(HashSet.class));\n                    for (Type decoratedType : decorator.getDecoratedTypes()) {\n                        try {\n                            bc.withSet(decoratedTypes).add(rttc.create(decoratedType));\n                        } catch (IllegalArgumentException e) {\n                            throw new IllegalStateException(\"Unable to construct type for \" + decorator\n                                    + \": \" + e.getMessage());\n                        }\n                    }\n                    bc.set(cc.this_().field(decoratedTypesField), decoratedTypes);\n\n                    LocalVar delegateType;\n                    try {\n                        delegateType = rttc.create(decorator.getDelegateType());\n                    } catch (IllegalArgumentException e) {\n                        throw new IllegalStateException(\"Unable to construct type for \" + decorator\n                                + \": \" + e.getMessage());\n                    }\n                    bc.set(cc.this_().field(delegateTypeField), delegateType);\n                });\n    }\n\n    static boolean isAbstractDecoratorImpl(BeanInfo bean, String providerTypeName) {\n        return bean.isDecorator() && ((DecoratorInfo) bean).isAbstract() && providerTypeName.endsWith(ABSTRACT_IMPL_SUFFIX);","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/DecoratorGenerator.java#L185-L221","documentation":"While generating the decorator's proxy class constructor, Arc converts each @Decorates decorated type into a runtime Type via RuntimeTypeCreator. If conversion fails (the IllegalArgumentException case) - typically because a type argument cannot be resolved to a loadable class - the generator aborts with this IllegalStateException.","triggerScenarios":"A decorator's decorated type (from the interface it implements with @Decorates) uses parameterized types whose raw classes are missing/unloadable in the application index or TCCL during decorator class generation.","commonSituations":"Decorating a generic interface whose type arguments reference a class that was removed or is in a dependency not on the runtime classpath; split-package/classloading issues in fast-jar.","solutions":["Ensure all classes used in the decorated type's generic signature are on the application classpath","Clean rebuild to refresh the bean archive index","Simplify the decorated type's generic parameters (use concrete resolvable types)","Check the decorator's delegate/decorated types for typos in type arguments"],"exampleFix":"// before\nclass MyDecorator implements Converter<SomeMissingClass> { @Decorates ... }\n// after\nclass MyDecorator implements Converter<String> { @Decorates ... }","handlingStrategy":"validation","validationCode":"// ensure decorated type raw class is loadable before decorating\nstatic void checkDecoratedType(Class<?> decorated) {\n  if (!decorated.isInterface()) throw new IllegalArgumentException(\"Must be interface: \" + decorated);\n  for (var t : decorated.getTypeParameters()) System.out.println(\"type param needs resolvable arg: \" + t);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep decorated interface type arguments concrete and on the classpath","Clean rebuild after refactoring generic interfaces"],"tags":["quarkus","arc","cdi","decorator","type-resolution"],"backgroundTag":"cdi-bean-type-resolution-failed","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"}