{"record":{"id":"a9d6562971fa373e","repo":"quarkusio/quarkus","slug":"multiple-beans-with-the-same-identifier-value-de","errorCode":null,"errorMessage":"Multiple  beans with the same @Identifier value detected: ; beans: ","messagePattern":"Multiple  beans with the same @Identifier value detected: ; beans: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/signals/deployment/src/main/java/io/quarkus/signals/deployment/SignalsProcessor.java","lineNumber":392,"sourceCode":"        List<String> orderedEnricherIds = discoverAndOrder(beanDiscovery, DotNames.SIGNAL_METADATA_ENRICHER,\n                \"SignalMetadataEnricher\");\n        List<String> orderedInterceptorIds = discoverAndOrder(beanDiscovery, DotNames.RECEIVER_INTERCEPTOR,\n                \"ReceiverInterceptor\");\n        return new OrderedSpiComponentsBuildItem(orderedEnricherIds, orderedInterceptorIds);\n    }\n\n    private static List<String> discoverAndOrder(BeanDiscoveryFinishedBuildItem beanDiscovery, DotName spiType,\n            String componentTypeName) {\n        Map<String, List<String>> beforeEdges = new HashMap<>();\n        Map<String, List<String>> afterEdges = new HashMap<>();\n        Map<String, List<BeanInfo>> idToBeans = new HashMap<>();\n\n        for (BeanInfo bean : beanDiscovery.beanStream().withBeanType(spiType)) {\n            String id = readIdentifier(bean, componentTypeName);\n            List<BeanInfo> beans = idToBeans.computeIfAbsent(id, k -> new ArrayList<>());\n            beans.add(bean);\n            if (beans.size() > 1) {\n                throw new IllegalStateException(\n                        \"Multiple \" + componentTypeName\n                                + \" beans with the same @Identifier value detected: \" + id\n                                + \"; beans: \" + beans);\n            }\n            if (bean.getTarget().isPresent()) {\n                AnnotationInstance orderAnnotation = bean.getTarget().get().declaredAnnotation(DotNames.RELATIVE_ORDER);\n                if (orderAnnotation != null) {\n                    AnnotationValue beforeValue = orderAnnotation.value(\"before\");\n                    if (beforeValue != null) {\n                        beforeEdges.put(id, List.of(beforeValue.asStringArray()));\n                    }\n                    AnnotationValue afterValue = orderAnnotation.value(\"after\");\n                    if (afterValue != null) {\n                        afterEdges.put(id, List.of(afterValue.asStringArray()));\n                    }\n                }\n            }\n        }","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/signals/deployment/src/main/java/io/quarkus/signals/deployment/SignalsProcessor.java#L374-L410","documentation":"When discovering ordered components (enrichers/interceptors) of a given SPI type, the processor indexes beans by their @io.smallrye.common.annotation.Identifier value. Two or more beans carry the same identifier, making the ordering ambiguous, so the build fails.","triggerScenarios":"Two beans implementing the same signals SPI interface (enricher or interceptor) both annotated with @Identifier(\"same-id\").","commonSituations":"Adding a second implementation of an SPI but reusing an existing identifier string, or registering a library bean plus your own with the same id.","solutions":["Rename the @Identifier value on one of the duplicate beans so ids are unique.","Remove one of the conflicting beans from the deployment (e.g. via @Exclude or uninstalling the extension/module).","If a library bean conflicts, use a custom identifier for your own bean."],"exampleFix":"// before\n@Identifier(\"my-enricher\")\nclass EnricherA implements Enricher { ... }\n@Identifier(\"my-enricher\")\nclass EnricherB implements Enricher { ... }\n\n// after\n@Identifier(\"my-enricher-a\")\nclass EnricherA implements Enricher { ... }\n@Identifier(\"my-enricher-b\")\nclass EnricherB implements Enricher { ... }","handlingStrategy":"validation","validationCode":"Set<String> seen = new HashSet<>();\nfor (Class<?> c : List.of(EnricherA.class, EnricherB.class)) {\n    String id = c.getAnnotation(Identifier.class).value();\n    if (!seen.add(id)) throw new IllegalStateException(\"duplicate @Identifier: \" + id);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use unique, prefix-qualified ids like \"com.acme.my-enricher\".","Grep the codebase for @Identifier values before adding a new component.","Centralize id constants to avoid string duplication."],"tags":["quarkus","cdi","duplicate-bean","identifier"],"backgroundTag":"duplicate-identifier-bean","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}