{"record":{"id":"1bbb115c788bb62e","repo":"quarkusio/quarkus","slug":"quarkus-does-not-support-cdi-full-specializes-ann","errorCode":null,"errorMessage":"Quarkus does not support CDI Full @Specializes annotation; try using an @Alternative instead. If you want to mark one or more archives as Quarkus compatible, take a look at io.quarkus.arc.deployment.KnownCompatibleBeanArchiveBuildItem.\nAnnotation was found in the following classes: <definitionErrors>","messagePattern":"Quarkus does not support CDI Full @Specializes annotation; try using an @Alternative instead\\. If you want to mark one or more archives as Quarkus compatible, take a look at io\\.quarkus\\.arc\\.deployment\\.KnownCompatibleBeanArchiveBuildItem\\.\nAnnotation was found in the following classes: <definitionErrors>","errorType":"exception","errorClass":"DefinitionException","httpStatus":null,"severity":"critical","filePath":"extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java","lineNumber":192,"sourceCode":"            validateArchiveCompatibility(rootArchive, rootArchive.getIndex(), knownCompatibleBeanArchives);\n            indexes.add(rootArchive.getIndex());\n        }\n        return CompositeIndex.create(indexes);\n    }\n\n    private void validateArchiveCompatibility(ApplicationArchive archive, IndexView index,\n            KnownCompatibleBeanArchives knownCompatibleBeanArchives) {\n        // check for occurrences of incompatible annotations - currently only @Specializes\n        Collection<AnnotationInstance> annotations = index.getAnnotations(DotNames.SPECIALIZES);\n        if (!annotations.isEmpty() && !knownCompatibleBeanArchives.isKnownCompatible(archive.getKey(),\n                KnownCompatibleBeanArchiveBuildItem.Reason.SPECIALIZES_ANNOTATION)) {\n            Set<String> definitionErrors = new HashSet<>();\n            for (AnnotationInstance annInstance : annotations) {\n                DotName targetClassName = annInstance.target().kind().equals(AnnotationTarget.Kind.CLASS)\n                        ? annInstance.target().asClass().name()\n                        : annInstance.target().asMethod().declaringClass().name();\n                definitionErrors.add(targetClassName.toString());\n                throw new DefinitionException(\n                        \"Quarkus does not support CDI Full @Specializes annotation; try using an @Alternative instead. \"\n                                +\n                                \"If you want to mark one or more archives as Quarkus compatible, take a \" +\n                                \"look at io.quarkus.arc.deployment.KnownCompatibleBeanArchiveBuildItem.\\n\" +\n                                \"Annotation was found in the following classes: \" + definitionErrors);\n            }\n        }\n    }\n\n    private boolean isExplicitBeanArchive(ApplicationArchive archive) {\n        return archive.apply(tree -> tree.contains(\"META-INF/beans.xml\") || tree.contains(\"WEB-INF/beans.xml\"));\n    }\n\n    private boolean isImplicitBeanArchive(IndexView index, Set<DotName> beanDefiningAnnotations) {\n        // NOTE: Implicit bean archive without beans.xml contains one or more bean classes with a bean defining annotation and no extension\n        return index.getAllKnownImplementors(DotNames.EXTENSION).isEmpty()\n                && index.getAllKnownImplementors(DotNames.BUILD_COMPATIBLE_EXTENSION).isEmpty()\n                && containsBeanDefiningAnnotation(index, beanDefiningAnnotations);","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java#L174-L210","documentation":"Quarkus Arc does not support CDI Full's @Specializes annotation. BeanArchiveProcessor.validateArchiveCompatibility scans bean archives for @Specializes and throws ArcDefinitionException (DefinitionException) listing the classes that declare it.","triggerScenarios":"A bean class (or a bean method's declaring class) in a bean archive uses @Specializes; the archive is not marked known-compatible and @Specializes is found on the application index.","commonSituations":"Porting a plain CDI (CDI Full/Weld) application to Quarkus; third-party jars containing @Specializes beans pulled in as dependencies.","solutions":["Remove @Specializes and replace with @Alternative (plus @Priority) where appropriate","Mark the archive as known-compatible via KnownCompatibleBeanArchiveBuildItem if the semantics are acceptable","Exclude the offending dependency/archive from bean discovery"],"exampleFix":"// before\n@Priority(1)\n@Specializes\npublic class MyService extends BaseService { ... }\n// after\n@Priority(1)\n@Alternative\npublic class MyService extends BaseService { ... }","handlingStrategy":"validation","validationCode":"Class<?> c = MySpecializingBean.class;\nif (c.isAnnotationPresent(jakarta.enterprise.inject.Specializes.class))\n    throw new IllegalStateException(\"@Specializes is not supported by Quarkus: \" + c.getName());\n// or scan archives:\nIndex i = Index.of(MySpecializingBean.class);\nif (!i.getAnnotations(DotName.createSimple(\"jakarta.enterprise.inject.Specializes\")).isEmpty()) throw new IllegalStateException(\"@Specializes found\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search dependencies for @Specializes before migrating to Quarkus","Replace @Specializes with @Alternative + @Priority during porting","Exclude incompatible CDI Full jars from bean discovery"],"tags":["quarkus","arc","cdi","incompatible-feature"],"backgroundTag":"unsupported-cdi-feature","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}