quarkusio/quarkus · error · RuntimeException
Failed to prepare injector constructor ${injectCtor} of byte
Error message
Failed to prepare injector constructor ${injectCtor} of bytecode recorder What it means
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.
Source
Thrown at core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java:1853
deferredParameters.add(new DeferredParameter() {
@Override
void doPrepare(MethodContext context) {
super.doPrepare(context);
result.doPrepare(context);
}
@Override
ResultHandle doLoad(MethodContext context, MethodCreator method, ResultHandle array) {
ResultHandle r = result.doLoad(context, method, array);
return method.newInstance(
MethodDescriptor.ofConstructor(RuntimeValue.class, Object.class), r);
}
});
}
}
}
} catch (Exception e) {
throw new RuntimeException("Failed to prepare injector constructor " + injectCtor + " of bytecode recorder",
e);
}
}
}
@Override
void doPrepare(MethodContext context) {
for (var i : deferredParameters) {
i.doPrepare(context);
}
super.doPrepare(context);
}
@Override
ResultHandle createValue(MethodContext context, MethodCreator method, ResultHandle array) {
if (injectCtor == null) {
return method.newInstance(ofConstructor(theClass));
} else {View on GitHub (pinned to e1c734241f)
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
Defensive patterns
Strategy: try-catch
Try / catch
try {
// augmentation / recording step
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Failed to prepare injector constructor")) {
e.getCause().printStackTrace(); // fix the real cause first
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Could not determine constructor for ${theClass} add @Inject
- Cannot inject object of type ${param}
- Failed to injector constructor ${injectCtor} of bytecode rec
- Unsupported value: ${value}
- Cannot create new DeferredArrayStoreParameter after array ha
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/c83528813c221a00.
Report an issue: GitHub.