quarkusio/quarkus · error · ConfigurationException

Annotation '<annotation>' placed on '<target>' must not have

Error message

Annotation '<annotation>' placed on '<target>' must not have blank value

What it means

EagerSecurityInterceptorBindingBuildItem.getBindingValue extracts the value of a security interceptor binding annotation placed on an endpoint. Quarkus requires the annotation's value attribute to be present and non-blank, otherwise it cannot construct a meaningful binding; a blank value triggers ConfigurationException naming the annotation and target.

Source

Thrown at extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/EagerSecurityInterceptorBindingBuildItem.java:85

    public DotName[] getAnnotationBindings() {
        return annotationBindings;
    }

    Function<String, Consumer<RoutingContext>> getInterceptorCreator() {
        return interceptorCreator;
    }

    public String getBindingValue(AnnotationInstance annotationInstance, DotName annotation,
            AnnotationTarget annotationTarget) {
        if (bindingValueExtractor != null) {
            return bindingValueExtractor.apply(annotationInstance);
        }
        if (bindingToValue.containsKey(annotation.toString())) {
            return bindingToValue.get(annotation.toString());
        }
        if (annotationInstance.value() == null || annotationInstance.value().asString().isBlank()) {
            throw new ConfigurationException("Annotation '" + annotation + "' placed on '"
                    + toTargetName(annotationTarget) + "' must not have blank value");
        }
        return annotationInstance.value().asString();
    }

    public static String toTargetName(AnnotationTarget target) {
        if (target.kind() == AnnotationTarget.Kind.METHOD) {
            return target.asMethod().declaringClass().name().toString() + "#" + target.asMethod().name();
        } else {
            return target.asClass().name().toString();
        }
    }

    boolean requiresSecurityCheck() {
        return requiresSecurityCheck;
    }

    boolean allowToRepeatThisInterceptorBinding() {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Provide a concrete value on the annotation: @MyBinding("some-value")
  2. Mark the annotation attribute required so the build fails fast at the declaration site
  3. Check the target named in the error message and fix the annotation there

Example fix

// before
@MySecurityBinding("")
public Response get() { ... }

// after
@MySecurityBinding("tenant-a")
public Response get() { ... }
Defensive patterns

Strategy: validation

Validate before calling

AnnotationInstance ann = target.annotation(BINDING_NAME);
if (ann == null || ann.value() == null || ann.value().asString().isBlank()) {
    throw new IllegalArgumentException(BINDING_NAME + " requires a non-blank value on " + target);
}

Prevention

When it happens

Trigger: Placing an annotation (e.g. a custom security binding) with @Attribute required but blank/empty value on a JAX-RS endpoint or route that EagerSecurityInterceptorProcessing intercepts; addInterceptedEndpoint -> getBindingValue throws when annotationInstance.value() is null or asString().isBlank().

Common situations: Hand-writing @MySecurityBinding("") or @MySecurityBinding (with optional value left unset) on endpoints; copy-pasting annotations from examples without filling values; refactors that clear annotation values.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/0c3aa0508e408892. Report an issue: GitHub.