quarkusio/quarkus · error · DeploymentException
Can only inject AsyncResponse on methods marked @Suspended o
Error message
Can only inject AsyncResponse on methods marked @Suspended on
What it means
Build-time validation error in EndpointIndexer: an endpoint method declares a parameter of type AsyncResponse but is not annotated with @Suspended, which RESTEasy Reactive requires to enable suspended async handling. The method/class context is appended to the message.
Source
Thrown at independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java:1536
currentMethodInfo);
}
}
if (!typeHandled) {
elementType = toClassName(paramType, currentClassInfo, actualEndpointInfo, index);
addReaderForType(additionalReaders, paramType);
if (type != ParameterType.CONTEXT && type != ParameterType.BEAN && type != ParameterType.BODY
&& type != ParameterType.ASYNC_RESPONSE && type != ParameterType.MULTI_PART_FORM) {
handleOtherParam(existingConverters, errorLocation, hasRuntimeConverters, builder, elementType,
currentMethodInfo);
}
if (type == ParameterType.CONTEXT && elementType.equals(SseEventSink.class.getName())) {
builder.setSse(true);
}
}
if (suspendedAnnotation != null && !elementType.equals(AsyncResponse.class.getName())) {
throw new DeploymentException(
"Can only inject AsyncResponse on methods marked @Suspended on " + builder.getErrorLocation());
}
if (builder.isSingle() && builder.getSeparator() != null) {
throw new DeploymentException(
"Single parameters should not be marked with @Separator on " + builder.getErrorLocation());
}
builder.setElementType(elementType);
return builder;
}
private boolean isFormParamConvertible(Type paramType) {
// let's not call the array converter for byte[] for multipart
if (paramType.kind() == Kind.ARRAY
&& paramType.asArrayType().constituent().kind() == Kind.PRIMITIVE
&& paramType.asArrayType().constituent().asPrimitiveType().primitive() == Primitive.BYTE) {
return false;
} else {
return true;View on GitHub (pinned to e1c734241f)
Solutions
- Annotate the AsyncResponse parameter with @Suspended
- Or use Uni/CompletionStage return types for async endpoints instead
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java:1536 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/0c46fd422072258d.
Report an issue: GitHub.