{"record":{"id":"121c0254d8e5cc67","repo":"quarkusio/quarkus","slug":"interceptionproxy-parameter-must-be-a-parameterize","errorCode":null,"errorMessage":"InterceptionProxy parameter must be a parameterized type: ${producerMethod}","messagePattern":"InterceptionProxy parameter must be a parameterized type: (.+?)","errorType":"exception","errorClass":"DefinitionException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java","lineNumber":205,"sourceCode":"        }\n\n        if (scope != null // `null` is just like `@Dependent`\n                && !BuiltinScope.DEPENDENT.is(scope)\n                && producerMethod.returnType().kind() == Kind.PARAMETERIZED_TYPE\n                && Types.containsTypeVariable(producerMethod.returnType())) {\n            throw new DefinitionException(\"Producer method return type is a parameterized type with a type variable, \"\n                    + \"its scope must be @Dependent: \" + producerMethod);\n        }\n\n        InterceptionProxyInfo interceptionProxy = null;\n        for (MethodParameterInfo parameter : producerMethod.parameters()) {\n            if (parameter.type().name().equals(DotNames.INTERCEPTION_PROXY)) {\n                if (interceptionProxy != null) {\n                    throw new DefinitionException(\n                            \"Declaring more than one InterceptionProxy parameter is invalid: \" + producerMethod);\n                }\n                if (parameter.type().kind() != Kind.PARAMETERIZED_TYPE) {\n                    throw new DefinitionException(\n                            \"InterceptionProxy parameter must be a parameterized type: \" + producerMethod);\n                }\n                DotName targetClass = producerMethod.returnType().name();\n                DotName bindingsSource = null;\n                if (parameter.hasAnnotation(DotNames.BINDINGS_SOURCE)) {\n                    Type bindingsSourceType = parameter.annotation(DotNames.BINDINGS_SOURCE).value().asClass();\n                    if (bindingsSourceType.kind() != Kind.CLASS) {\n                        throw new DefinitionException(\"@BindingsSource may only define a class type, got \"\n                                + bindingsSourceType.kind() + \": \" + producerMethod);\n                    }\n                    bindingsSource = bindingsSourceType.name();\n                }\n                interceptionProxy = new InterceptionProxyInfo(targetClass, bindingsSource);\n            }\n        }\n\n        List<Injection> injections = Injection.forBean(producerMethod, declaringBean, beanDeployment, transformer,\n                Injection.BeanType.PRODUCER_METHOD);","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java#L187-L223","documentation":"In ArC (Quarkus CDI), a producer method parameter of type InterceptionProxy must be declared as a parameterized type (e.g. InterceptionProxy<MyService>) because ArC needs the target class to build the proxy. A raw InterceptionProxy parameter carries no target type, so bean creation is rejected with a DefinitionException at build time.","triggerScenarios":"A producer method created via Beans.createProducerMethod declares a parameter whose type is DotNames.INTERCEPTION_PROXY but whose Type kind is not PARAMETERIZED_TYPE — e.g. a raw `InterceptionProxy proxy` parameter without type arguments.","commonSituations":"Hand-written or generated producer methods where the generic type argument was omitted; code migrated from interceptor-based designs where InterceptionProxy was written without `<T>`; annotation-processing code paths that strip or lose type arguments.","solutions":["Add an explicit type argument to the InterceptionProxy parameter, matching the bean type produced by the producer method","Rebuild/re-run the ArC annotation processing so the parameter type is resolved as a parameterized type","If no interception proxy is needed, remove the InterceptionProxy parameter entirely"],"exampleFix":"// before\n@Produces\nMyService produce(InterceptionProxy proxy) { return proxy.create(); }\n// after\n@Produces\nMyService produce(InterceptionProxy<MyService> proxy) { return proxy.create(); }","handlingStrategy":"validation","validationCode":"// build-time check before processing a producer method parameter\nif (param.name().equals(DotNames.INTERCEPTION_PROXY)\n        && param.type().kind() != org.jboss.jandex.Type.Kind.PARAMETERIZED_TYPE) {\n    throw new IllegalArgumentException(\"InterceptionProxy parameter needs type args: \" + param);\n}","typeGuard":null,"tryCatchPattern":"try {\n    beanArchiveIndex.process(...); // ArC processing\n} catch (DefinitionException e) {\n    if (e.getMessage().contains(\"InterceptionProxy parameter must be a parameterized type\")) {\n        logger.errorf(\"Fix producer method to use InterceptionProxy<T>: %s\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Always write InterceptionProxy with an explicit type argument matching the producer's bean type","Run Quarkus dev mode early to catch DefinitionExceptions at build time","Avoid writing raw generic types (rawtypes warnings are a good signal)"],"tags":["cdi","arc","bean-definition","generics"],"backgroundTag":"interception-proxy-raw-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"}