quarkusio/quarkus · error · IllegalStateException
A receiver method must not be static:
Error message
A receiver method must not be static:
What it means
The Quarkus signals extension builds invokers for receiver methods (methods annotated to receive signals). A receiver method must be an instance method because the bean instance is used as the receiver target; a static method has no instance to invoke against. During discovery of receivers, a static method is rejected with this IllegalStateException.
Source
Thrown at extensions/signals/deployment/src/main/java/io/quarkus/signals/deployment/SignalsProcessor.java:153
throw new IllegalStateException(
"A receiver method must have exactly one parameter annotated with @Receives: "
+ methodDesc(method));
}
signalParam = param;
}
}
}
if (!seenMethods.add(method.signatureKey())) {
// Overridden by a subclass
continue;
}
if (signalParam != null) {
if (Modifier.isPrivate(method.flags())) {
throw new IllegalStateException(
"A receiver method must not be private: " + methodDesc(method));
}
if (Modifier.isStatic(method.flags())) {
throw new IllegalStateException(
"A receiver method must not be static: " + methodDesc(method));
}
ExecutionModel executionModel = getExecutionModel(method);
if (!receiverExecutorImplementation.isSupported(executionModel)) {
throw new IllegalStateException(
"%s execution model is not supported: %s".formatted(executionModel, methodDesc(method)));
}
InvokerBuilder invokerBuilder = invokerFactory.createInvoker(bean, method)
.withInstanceLookup();
if (params.size() > 1) {
for (MethodParameterInfo param : params) {
if (param != signalParam) {
invokerBuilder.withArgumentLookup(param.position());
}
}
}
List<AnnotationInstance> qualifiers = new ArrayList<>();
for (AnnotationInstance a : signalParam.declaredAnnotations()) {View on GitHub (pinned to e1c734241f)
Solutions
- Remove the `static` modifier from the receiver method.
- Ensure the method is on a CDI bean instance so the generated invoker can call it on the bean.
- If the method was never intended to receive signals, remove the signal annotation/parameter so it is not discovered as a receiver.
Example fix
// before
@SignalReceiver
static void onSig(SignalEvent evt) { ... }
// after
@SignalReceiver
void onSig(SignalEvent evt) { ... } Defensive patterns
Strategy: validation
Validate before calling
if (java.lang.reflect.Modifier.isStatic(ReceiverClass.class.getDeclaredMethod("onSig", SignalEvent.class).getModifiers())) { throw new IllegalStateException("receiver method must not be static"); } Prevention
- Never mark signal receiver methods static.
- Keep receiver methods on managed CDI bean classes.
- Review refactors that add `static` to instance handler methods.
When it happens
Trigger: Declaring a signal receiver method as `static` (e.g. `static void onSignal(...)` with a signal parameter) in a bean discovered by the signals processor.
Common situations: Developers copying a listener style from plain-Java signal handling where static handlers are common, or making a helper method static after refactoring.
Related errors
- A receiver method must have exactly one parameter annotated
- A receiver method must not be private:
- @CachedResults class must be an interface or declare a no-ar
- Not possible to define the scope %s for the REST client %s
- %s execution model is not supported: %s
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/cd9e0cd33338e249.
Report an issue: GitHub.