quarkusio/quarkus · error · IllegalStateException

bean must be annotated with @io.smallrye.common.annotation

Error message

 bean  must be annotated with @io.smallrye.common.annotation.Identifier

What it means

Component beans (enrichers/interceptors) of the signals SPI must carry @io.smallrye.common.annotation.Identifier so the processor can key and order them. A bean implementing the SPI without that qualifier is rejected at build time.

Source

Thrown at extensions/signals/deployment/src/main/java/io/quarkus/signals/deployment/SignalsProcessor.java:424

                        afterEdges.put(id, List.of(afterValue.asStringArray()));
                    }
                }
            }
        }

        if (idToBeans.keySet().isEmpty()) {
            return List.of();
        }
        return TopologicalSort.sort(idToBeans.keySet(), beforeEdges, afterEdges, componentTypeName);
    }

    private static String readIdentifier(BeanInfo bean, String componentTypeName) {
        if (bean.getTarget().isEmpty()) {
            throw new IllegalStateException(componentTypeName + " bean has no target: " + bean);
        }
        Optional<AnnotationInstance> identifier = bean.getQualifier(DotNames.IDENTIFIER);
        if (identifier.isEmpty()) {
            throw new IllegalStateException(
                    componentTypeName + " bean " + bean.getBeanClass()
                            + " must be annotated with @io.smallrye.common.annotation.Identifier");
        }
        AnnotationValue value = identifier.get().value();
        if (value == null || value.asString().isBlank()) {
            throw new IllegalStateException(
                    componentTypeName + " bean " + bean.getBeanClass()
                            + " has an @Identifier annotation with an empty value");
        }
        return value.asString();
    }

    @BuildStep
    ReceiverExecutorImplementationBuildItem supportedExecutionModels(Capabilities capabilities) {
        if (capabilities.isPresent(Capability.VERTX)) {
            return new ReceiverExecutorImplementationBuildItem(VERTX);
        } else {
            // Note that quarkus-virtual-threads does require quarkus-vertx,

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add @io.smallrye.common.annotation.Identifier("unique-id") to the bean class.
  2. Verify the bean actually implements the intended SPI; if not, remove the accidental implementation.
  3. Give each SPI implementation a distinct identifier string.

Example fix

// before
class MyEnricher implements Enricher { ... }

// after
@Identifier("my-enricher")
class MyEnricher implements Enricher { ... }
Defensive patterns

Strategy: validation

Validate before calling

if (!componentClass.isAnnotationPresent(Identifier.class)) { throw new IllegalStateException(componentClass + " must be annotated with @Identifier"); }

Prevention

When it happens

Trigger: A bean implements a signals SPI interface but is missing the @Identifier annotation entirely.

Common situations: Adding a new enricher/interceptor implementation and forgetting the required @Identifier annotation, or upgrading the extension which newly mandates it.

Related errors


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