{"record":{"id":"43f5aa5503d399de","repo":"quarkusio/quarkus","slug":"undeclared-checked-throwable-rethrown-during-bean","errorCode":null,"errorMessage":"Undeclared checked Throwable rethrown during bean instance creation (no own message)","messagePattern":"Undeclared checked Throwable rethrown during bean instance creation \\(no own message\\)","errorType":"exception","errorClass":"UndeclaredThrowableException","httpStatus":null,"severity":"error","filePath":"extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/BeanContainerImpl.java","lineNumber":118,"sourceCode":"            this.type = type;\n        }\n\n        @SuppressWarnings(\"unchecked\")\n        @Override\n        public BeanContainer.Instance<T> create() {\n            try {\n                DefaultInstanceFactory.class.getModule().addReads(type.getModule());\n                T instance = (T) LOOKUP.findConstructor(type, VOID_TYPE).invoke();\n                return new BeanContainer.Instance<>() {\n                    @Override\n                    public T get() {\n                        return instance;\n                    }\n                };\n            } catch (RuntimeException | Error e) {\n                throw e;\n            } catch (Throwable t) {\n                throw new UndeclaredThrowableException(t);\n            }\n        }\n    }\n}\n","sourceCodeStart":100,"sourceCodeEnd":123,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/BeanContainerImpl.java#L100-L123","documentation":"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.","triggerScenarios":"Thrown at extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/BeanContainerImpl.java:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}