quarkusio/quarkus · error · UndeclaredThrowableException
Undeclared checked Throwable rethrown during bean instance c
Error message
Undeclared checked Throwable rethrown during bean instance creation (no own message)
What it means
Thrown by DefaultInstanceFactory.create in BeanContainerImpl when reflectively invoking a bean constructor surfaces a checked Throwable that MethodHandle invocation wraps and rethrows undeclared. The catch block rethrows RuntimeException/Error directly; a checked Throwable with no message of its own is rewrapped so the original cause is preserved. It indicates the bean's constructor threw a checked exception the factory could not declare, and the payload is the constructor's own failure.
Source
Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/BeanContainerImpl.java:118
this.type = type;
}
@SuppressWarnings("unchecked")
@Override
public BeanContainer.Instance<T> create() {
try {
DefaultInstanceFactory.class.getModule().addReads(type.getModule());
T instance = (T) LOOKUP.findConstructor(type, VOID_TYPE).invoke();
return new BeanContainer.Instance<>() {
@Override
public T get() {
return instance;
}
};
} catch (RuntimeException | Error e) {
throw e;
} catch (Throwable t) {
throw new UndeclaredThrowableException(t);
}
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the cause chain of the thrown exception to identify which bean constructor failed and why
- Fix the underlying constructor failure (missing config, unavailable dependency, NPE during field initialization)
- If the bean legitimately throws, catch the checked exception inside the constructor instead of letting it escape instance creation
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/BeanContainerImpl.java:118 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/43f5aa5503d399de.
Report an issue: GitHub.