quarkusio/quarkus · error · UnsupportedOperationException
Unsupported value:
Error message
Unsupported value:
What it means
AnnotationLiteralProcessor.loadValue() converts a Jandex annotation member value into a runtime expression that builds an AnnotationLiteral. Its switch covers primitive types, String, Class, enum, and annotation component kinds; if the Jandex AnnotationValue has a kind outside that set, it throws UnsupportedOperationException. Reaching this indicates an unexpected/unsupported annotation member value kind in the CDI processing pipeline.
Source
Thrown at independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/AnnotationLiteralProcessor.java:324
yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_DOUBLE_ARRAY);
} else if (ConstantDescs.CD_char.equals(componentType)) {
yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_CHAR_ARRAY);
} else if (ConstantDescs.CD_String.equals(componentType)) {
yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_STRING_ARRAY);
} else if (ConstantDescs.CD_Class.equals(componentType)) {
yield bc.getStaticField(FieldDescs.ANNOTATION_LITERALS_EMPTY_CLASS_ARRAY);
} else {
yield bc.newEmptyArray(componentType, Const.of(0));
}
}
default -> {
// at this point, the only possible component kind is "array"
throw new UnsupportedOperationException("Array component kind is " + componentKind
+ ", this should never happen");
}
};
}
default -> throw new UnsupportedOperationException("Unsupported value: " + annotationMemberValue);
};
}
private static ClassDesc componentTypeOf(MethodInfo annotationMember) {
assert annotationMember.returnType().kind() == Type.Kind.ARRAY;
return classDescOf(annotationMember.returnType().asArrayType().componentType());
}
// ---
private static String componentType(MethodInfo method) {
return componentTypeName(method).toString();
}
private static DotName componentTypeName(MethodInfo method) {
ArrayType arrayType = method.returnType().asArrayType();
return arrayType.constituent().name();
}View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the annotation member at fault and change its type to a CDI-safe type (primitive, String, Class, enum, nested annotation, or array thereof)
- Annotate non-binding complex members with @Nonbinding if the annotation is an interceptor binding/qualifier so the value is never rendered
- Upgrade Quarkus/Arc — new value kinds are sometimes added in newer versions
- If the annotation comes from a third-party library, avoid using it where Arc must synthesize a literal, or wrap/remove the member
Example fix
// before
@interface MyBinding { ThreadLocal<String> weird(); }
// after
@interface MyBinding { @Nonbinding String value() default ""; } Defensive patterns
Strategy: validation
Validate before calling
for (AnnotationInstance ann : annotations) {
for (AnnotationValue v : ann.values()) {
if (!isSupportedKind(v.kind())) throw new IllegalStateException("Unsupported member: " + v.name());
}
}
static boolean isSupportedKind(AnnotationValue.Kind k) {
return switch (k) {
case BOOLEAN, BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, CHAR, STRING, CLASS, ENUM, NESTED, ARRAY -> true;
default -> false;
};
} Type guard
static boolean isSupportedAnnotationValue(AnnotationValue v) {
return v != null && isSupportedKind(v.kind());
} Try / catch
try { processor.loadValue(member, value); }
catch (UnsupportedOperationException e) { throw new DeploymentException("Bad annotation member " + member, e); } Prevention
- Keep annotation members to CDI-legal types (primitive, String, Class, enum, nested annotation, arrays)
- Mark complex members @Nonbinding on interceptor bindings/qualifiers
- Test custom annotations with an ArC deployment early
When it happens
Trigger: An annotation used in bean metadata has a member whose Jandex value kind is not one of the handled kinds (e.g. nested/odd array component kind or a non-standard value type) when Arc builds annotation literal creation code during deployment.
Common situations: Custom annotations with unusual member types used on beans/interceptors/qualifiers; Jandex/JBoss-Classfile version changes introducing new value kinds; hand-written bytecode or bytecode transformations producing exotic annotation values.
Related errors
- No TCCL available
- Unknown annotation attribute value:
- Unable to construct type for ${btRemovedBean}: ${e.getMessag
- Multiple disposed parameters found for ${disposerMethod}
- Invalid injection of Interceptor<T> bean, can only be used i
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/99205eeb186cabce.
Report an issue: GitHub.