quarkusio/quarkus · error · UnsupportedOperationException
Unsupported value: ${value}
Error message
Unsupported value: ${value} What it means
BytecodeRecorderImpl supports recording enum-valued ConfigurationState entries as CONSTANT_POOL, FIELD, or ENUM storage types. When a recorded value falls into NESTED (or any unknown) category, the value loader has no strategy to emit it and throws UnsupportedOperationException('Unsupported value: ...').
Source
Thrown at core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java:1980
retValue = valueMethod.load(value.asDouble());
break;
case CHARACTER:
retValue = valueMethod.load(value.asChar());
break;
case CLASS:
retValue = valueMethod.loadClassFromTCCL(value.asClass().name().toString());
break;
case ARRAY:
retValue = arrayValue(value, valueMethod, method, annotationClass);
break;
case ENUM:
retValue = valueMethod
.readStaticField(FieldDescriptor.of(value.asEnumType().toString(), value.asEnum(),
value.asEnumType().toString()));
break;
case NESTED:
default:
throw new UnsupportedOperationException("Unsupported value: " + value);
}
return retValue;
}
};
}
static ResultHandle arrayValue(AnnotationValue value, BytecodeCreator valueMethod, MethodInfo method,
ClassInfo annotationClass) {
ResultHandle retValue;
switch (value.componentKind()) {
case CLASS:
Type[] classArray = value.asClassArray();
retValue = valueMethod.newArray(componentType(method), valueMethod.load(classArray.length));
for (int i = 0; i < classArray.length; i++) {
valueMethod.writeArrayValue(retValue, i, valueMethod.loadClassFromTCCL(classArray[i].name().toString()));
}
break;
case STRING:View on GitHub (pinned to e1c734241f)
Solutions
- Flatten the nested config value into primitives/Strings/enums before recording
- Use an ObjectSubstitution or proper serialization for the complex object instead of the enum path
- Record the enum value explicitly so it uses the CONSTANT_POOL/ENUM path
- Check whether the config type should be an enum mapping (@ConfigMapping with enums) rather than a nested object
Example fix
// before // recorded value: nested object passed where enum expected -> NESTED storage // after myConfig.myEnum = Mode.FAST; // simple enum value, not a nested group
Defensive patterns
Strategy: validation
Validate before calling
// ensure only simple values reach the enum/value load path
if (!(value instanceof Enum || value instanceof String || value instanceof Number || value instanceof Boolean)) {
throw new IllegalArgumentException("Value must be a simple constant, not nested: " + value);
} Try / catch
try {
recordedLoader.apply(value);
} catch (UnsupportedOperationException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Unsupported value:")) {
throw new IllegalStateException("Flatten/serialize nested config value before recording", e);
}
throw e;
} Prevention
- Record only primitives, Strings and enums through the value path
- Use ObjectSubstitution for complex/nested objects
- Keep config shapes stable when refactoring extensions
When it happens
Trigger: Reading a recorded configuration key whose value was stored as NESTED — i.e. a complex/nested config object — through the enum value-loading path (loadEnum or similar), rather than through object serialization.
Common situations: A config property is an object/nested group but is consumed in code expecting a simple enum value; extension config changed from enum to nested object (or vice versa) during a refactor; misuse of the recording API with a nested config value where only enums/primitives are supported.
Related errors
- Could not determine constructor for ${theClass} add @Inject
- Cannot inject object of type ${param}
- Failed to prepare injector constructor ${injectCtor} of byte
- Cannot create new DeferredArrayStoreParameter after array ha
- The configuration ${clazz} is missing the @ConfigRoot annota
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/0aeda41f40262441.
Report an issue: GitHub.