quarkusio/quarkus · error · IllegalStateException
It is not possible to specify multiple creation methods
Error message
It is not possible to specify multiple creation methods
What it means
SyntheticBeanBuildItem's configurator allows exactly one creation mechanism. checkMultipleCreationMethods() is called by supplier(), runtimeValue(), createWith() and runtimeProxy(), and throws IllegalStateException if any creation method was already set, preventing ambiguous bean instantiation strategies.
Source
Thrown at extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SyntheticBeanBuildItem.java:298
}
Function<SyntheticCreationalContext<?>, ?> getFunction() {
return fun;
}
Object getRuntimeProxy() {
return runtimeProxy;
}
Supplier<ActiveResult> getCheckActive() {
return checkActive;
}
private void checkMultipleCreationMethods() {
if (runtimeProxy == null && runtimeValue == null && supplier == null && fun == null) {
return;
}
throw new IllegalStateException("It is not possible to specify multiple creation methods");
}
private void checkReturnedProxy(Object object) {
if (object instanceof ReturnedProxy) {
return;
}
throw new IllegalArgumentException(
"The object is not a proxy returned from a recorder method: " + object.toString());
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Keep only one creation call — remove the redundant .supplier()/.runtimeValue()/.createWith()/.runtimeProxy()
- If both flavors are needed, build two separate SyntheticBeanBuildItems or choose one mechanism
- Wrap configuration in a single method so creation is set exactly once
- Review the diff for duplicated chained calls on the same configurator
Example fix
// before configure(Foo.class).supplier(recorder.foo()).runtimeValue(recorder.fooValue()).done(); // after configure(Foo.class).supplier(recorder.foo()).done();
Defensive patterns
Strategy: validation
Validate before calling
int creationCalls = countOf(supplier, runtimeValue, createWith, runtimeProxy); // keep == 1
Prevention
- Set the creation method exactly once per configurator
- Centralize synthetic bean registration in one helper method
- Grep configurator chains for duplicated creation calls during code review
When it happens
Trigger: Calling two or more of .supplier(), .runtimeValue(), .createWith(), or .runtimeProxy() on the same ExtendedBeanConfigurator before done().
Common situations: Copy-pasting configurator chains from other extensions; merging two bean registrations during refactoring; conditional code that adds a runtimeValue on top of an existing supplier.
Related errors
- Synthetic bean does not provide a creation method, use Exten
- Synthetic bean has ExtendedBeanConfigurator#checkActive(), b
- The object is not a proxy returned from a recorder method: <
- Invalid annotation target: <target>
- The @Blocking, @NonBlocking and @RunOnVirtualThread annotati
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/1327008222e01bf8.
Report an issue: GitHub.