{"record":{"id":"75ef16a62922eabd","repo":"quarkusio/quarkus","slug":"bean-discovery-mode-of-all-not-supported-in-cdi","errorCode":null,"errorMessage":"Bean discovery mode of 'all' not supported in CDI Lite","messagePattern":"Bean discovery mode of 'all' not supported in CDI Lite","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/tcks/arquillian/src/main/java/io/quarkus/arc/arquillian/BeanArchive.java","lineNumber":82,"sourceCode":"        String content = bytes.toString(StandardCharsets.UTF_8);\n\n        if (content.trim().isEmpty()) {\n            return true;\n        }\n\n        if (content.contains(\"bean-discovery-mode='annotated'\")\n                || content.contains(\"bean-discovery-mode=\\\"annotated\\\"\")) {\n            return true;\n        }\n\n        if (content.contains(\"bean-discovery-mode='none'\")\n                || content.contains(\"bean-discovery-mode=\\\"none\\\"\")) {\n            return false;\n        }\n\n        if (content.contains(\"bean-discovery-mode='all'\")\n                || content.contains(\"bean-discovery-mode=\\\"all\\\"\")) {\n            throw new IllegalStateException(\"Bean discovery mode of 'all' not supported in CDI Lite\");\n        }\n\n        // bean discovery mode not present, defaults to `annotated`\n        return true;\n    }\n}\n","sourceCodeStart":64,"sourceCodeEnd":89,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/tcks/arquillian/src/main/java/io/quarkus/arc/arquillian/BeanArchive.java#L64-L89","documentation":"The ArC TCK Arquillian integration's BeanArchive.detect() parses beans.xml content and rejects archives declaring bean-discovery-mode=\"all\" with this IllegalStateException, because ArC implements CDI Lite which only supports 'annotated' (and 'none') discovery modes. Full 'all' mode bean discovery is not available.","triggerScenarios":"Deploying an archive whose beans.xml contains bean-discovery-mode='all' (single or double quotes) when running against Quarkus/ArC.","commonSituations":"Porting an existing Java EE/Jakarta EE application to Quarkus without updating beans.xml; copying beans.xml from a full CDI container project; libraries bundled in a TCK/deployment that declare discovery mode 'all'.","solutions":["Change bean-discovery-mode to 'annotated' in beans.xml","Remove beans.xml entirely (defaults to annotated discovery)","Add bean-defining annotations (@ApplicationScoped, etc.) to classes that relied on 'all' mode discovery","Use 'none' only if you intentionally want no bean discovery for that archive"],"exampleFix":"// before\n<beans xmlns=\"...\" version=\"3.0\" bean-discovery-mode=\"all\">\n// after\n<beans xmlns=\"...\" version=\"3.0\" bean-discovery-mode=\"annotated\">","handlingStrategy":"validation","validationCode":"String content = Files.readString(beansXml);\nif (content.contains(\"bean-discovery-mode=\\\"all\\\"\") || content.contains(\"bean-discovery-mode='all'\"))\n    throw new IllegalStateException(\"Change to 'annotated' — CDI Lite does not support 'all'\");","typeGuard":null,"tryCatchPattern":"try { deploy(archive); }\ncatch (IllegalStateException e) { if (e.getMessage().contains(\"'all' not supported\")) log.error(\"Fix beans.xml to use annotated discovery\"); throw e; }","preventionTips":["Audit beans.xml files when migrating to Quarkus","Rely on bean-defining annotations instead of 'all' discovery","Use beans.xml only when you need 'none' or 'annotated'"],"tags":["cdi-lite","beans-xml","bean-discovery","quarkus-arc"],"backgroundTag":"unsupported-bean-discovery-mode","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"}