quarkusio/quarkus · error · DefinitionException
InterceptionProxy parameter must be a parameterized type: ${
Error message
InterceptionProxy parameter must be a parameterized type: ${producerMethod} What it means
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.
Source
Thrown at independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java:205
}
if (scope != null // `null` is just like `@Dependent`
&& !BuiltinScope.DEPENDENT.is(scope)
&& producerMethod.returnType().kind() == Kind.PARAMETERIZED_TYPE
&& Types.containsTypeVariable(producerMethod.returnType())) {
throw new DefinitionException("Producer method return type is a parameterized type with a type variable, "
+ "its scope must be @Dependent: " + producerMethod);
}
InterceptionProxyInfo interceptionProxy = null;
for (MethodParameterInfo parameter : producerMethod.parameters()) {
if (parameter.type().name().equals(DotNames.INTERCEPTION_PROXY)) {
if (interceptionProxy != null) {
throw new DefinitionException(
"Declaring more than one InterceptionProxy parameter is invalid: " + producerMethod);
}
if (parameter.type().kind() != Kind.PARAMETERIZED_TYPE) {
throw new DefinitionException(
"InterceptionProxy parameter must be a parameterized type: " + producerMethod);
}
DotName targetClass = producerMethod.returnType().name();
DotName bindingsSource = null;
if (parameter.hasAnnotation(DotNames.BINDINGS_SOURCE)) {
Type bindingsSourceType = parameter.annotation(DotNames.BINDINGS_SOURCE).value().asClass();
if (bindingsSourceType.kind() != Kind.CLASS) {
throw new DefinitionException("@BindingsSource may only define a class type, got "
+ bindingsSourceType.kind() + ": " + producerMethod);
}
bindingsSource = bindingsSourceType.name();
}
interceptionProxy = new InterceptionProxyInfo(targetClass, bindingsSource);
}
}
List<Injection> injections = Injection.forBean(producerMethod, declaringBean, beanDeployment, transformer,
Injection.BeanType.PRODUCER_METHOD);View on GitHub (pinned to e1c734241f)
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
Example fix
// before
@Produces
MyService produce(InterceptionProxy proxy) { return proxy.create(); }
// after
@Produces
MyService produce(InterceptionProxy<MyService> proxy) { return proxy.create(); } Defensive patterns
Strategy: validation
Validate before calling
// build-time check before processing a producer method parameter
if (param.name().equals(DotNames.INTERCEPTION_PROXY)
&& param.type().kind() != org.jboss.jandex.Type.Kind.PARAMETERIZED_TYPE) {
throw new IllegalArgumentException("InterceptionProxy parameter needs type args: " + param);
} Try / catch
try {
beanArchiveIndex.process(...); // ArC processing
} catch (DefinitionException e) {
if (e.getMessage().contains("InterceptionProxy parameter must be a parameterized type")) {
logger.errorf("Fix producer method to use InterceptionProxy<T>: %s", e.getMessage());
}
throw e;
} Prevention
- 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)
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Declaring class of a managed bean is generic, its scope must
- @BindingsSource may only define a class type, got ${kind}: $
- Producer field type is a parameterized type with a type vari
- Type of injected Bean<T> does not match the type of the bean
- Injected @Intercepted Bean<?> has to use unbound wildcard as
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/121c0254d8e5cc67.
Report an issue: GitHub.