{"record":{"id":"c83528813c221a00","repo":"quarkusio/quarkus","slug":"failed-to-prepare-injector-constructor-injectcto","errorCode":null,"errorMessage":"Failed to prepare injector constructor ${injectCtor} of bytecode recorder","messagePattern":"Failed to prepare injector constructor (.+?) of bytecode recorder","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java","lineNumber":1853,"sourceCode":"                                deferredParameters.add(new DeferredParameter() {\n                                    @Override\n                                    void doPrepare(MethodContext context) {\n                                        super.doPrepare(context);\n                                        result.doPrepare(context);\n                                    }\n\n                                    @Override\n                                    ResultHandle doLoad(MethodContext context, MethodCreator method, ResultHandle array) {\n                                        ResultHandle r = result.doLoad(context, method, array);\n                                        return method.newInstance(\n                                                MethodDescriptor.ofConstructor(RuntimeValue.class, Object.class), r);\n                                    }\n                                });\n                            }\n                        }\n                    }\n                } catch (Exception e) {\n                    throw new RuntimeException(\"Failed to prepare injector constructor \" + injectCtor + \" of bytecode recorder\",\n                            e);\n                }\n            }\n        }\n\n        @Override\n        void doPrepare(MethodContext context) {\n            for (var i : deferredParameters) {\n                i.doPrepare(context);\n            }\n            super.doPrepare(context);\n        }\n\n        @Override\n        ResultHandle createValue(MethodContext context, MethodCreator method, ResultHandle array) {\n            if (injectCtor == null) {\n                return method.newInstance(ofConstructor(theClass));\n            } else {","sourceCodeStart":1835,"sourceCodeEnd":1871,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L1835-L1871","documentation":"This wraps any exception thrown while BytecodeRecorderImpl prepares the @Inject constructor of a recorded class: resolving parameters (Class, RuntimeValue, registered values) and creating the generated method that will call the constructor. The original cause is chained and should be inspected to find the real problem.","triggerScenarios":"Any Exception during DeferredParameter preparation for the recorded object's inject constructor — e.g. reflective errors, invalid recorded configuration values, serialization failures of parameter objects, or the parameter-resolution code paths (150/151/152 style problems) surfacing as cause.","commonSituations":"Extension augmentation fails after adding a new constructor parameter to a recorded class; a config object recorded via ObjectSerializer fails to serialize; incompatible Quarkus core/extension versions where the recorder contract changed.","solutions":["Read the 'Caused by' chain to identify the underlying failure and fix that first","Check the constructor parameter types against what the recorder supports (primitives, String, Class with recorded value, RuntimeValue with recorded value, serializable config)","Rebuild cleanly (./mvnw clean install) to clear stale generated bytecode after changing recorder classes","Verify core and extension versions match; rebase/upgrade consistently"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    // augmentation / recording step\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Failed to prepare injector constructor\")) {\n        e.getCause().printStackTrace(); // fix the real cause first\n    }\n    throw e;\n}","preventionTips":["Always inspect the 'Caused by' chain of augmentation failures","Keep recorded class constructor params limited to recorder-supported types","Rebuild with ./mvnw clean install after touching recorder classes","Keep Quarkus core and extension versions aligned"],"tags":["build-time","bytecode-recorder","augmentation","quarkus-extension"],"backgroundTag":"recorder-constructor-preparation-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}