{"record":{"id":"40729fbb2371d4de","repo":"quarkusio/quarkus","slug":"failed-to-injector-constructor-injectctor-of-by","errorCode":null,"errorMessage":"Failed to injector constructor ${injectCtor} of bytecode recorder","messagePattern":"Failed to 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":1880,"sourceCode":"                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 {\n                try {\n                    List<ResultHandle> handles = new ArrayList<>();\n                    for (var result : deferredParameters) {\n                        handles.add(context.loadDeferred(result));\n                    }\n                    return method.newInstance(ofConstructor(injectCtor.getDeclaringClass(), injectCtor.getParameterTypes()),\n                            handles.toArray(ResultHandle[]::new));\n                } catch (Exception e) {\n                    throw new RuntimeException(\"Failed to injector constructor \" + injectCtor + \" of bytecode recorder\", e);\n                }\n            }\n        }\n    }\n\n    static final class SubstitutionHolder {\n        final Class<?> from;\n        final Class<?> to;\n        final Class<? extends ObjectSubstitution<?, ?>> sub;\n\n        SubstitutionHolder(Class<?> from, Class<?> to, Class<? extends ObjectSubstitution<?, ?>> sub) {\n            this.from = from;\n            this.to = to;\n            this.sub = sub;\n        }\n    }\n\n    static final class NonDefaultConstructorHolder {","sourceCodeStart":1862,"sourceCodeEnd":1898,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java#L1862-L1898","documentation":"This wraps any exception thrown in the generated 'method' while BytecodeRecorderImpl actually emits the constructor invocation (loadDeferred of each deferred parameter plus newInstance of the inject constructor). Unlike 153 (prepare phase) this happens during the final load/emit phase of the recorder method.","triggerScenarios":"An Exception is thrown when loading deferred parameter ResultHandles or when calling gizmo newInstance with the inject constructor's declaring class and parameter types — e.g. mismatched parameter types, deferred load failures, or invalid handles produced in preparation.","commonSituations":"Constructor signature changed but cached/stale generated code or mismatched parameter ordering remains; a deferred parameter's value cannot be materialized in the target method context; internal Gizmo errors after Quarkus upgrades.","solutions":["Inspect the 'Caused by' to find the actual failing deferred parameter or handle","Rebuild the extension and application from clean state (./mvnw clean install)","Ensure the @Inject constructor's parameter order/types match what is recorded and registered","Update Quarkus core and extensions to consistent versions"],"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 injector constructor\")) {\n        e.getCause().printStackTrace(); // diagnose the failing deferred load\n    }\n    throw e;\n}","preventionTips":["Do not change a recorded constructor's signature without a clean rebuild","Match constructor parameter order/types with what the recorder registers","Keep Quarkus core and extension versions consistent"],"tags":["build-time","bytecode-recorder","gizmo","augmentation"],"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-12T22:17:10.623Z"}