quarkusio/quarkus · error · IllegalStateException

Bean discovery mode of 'all' not supported in CDI Lite

Error message

Bean discovery mode of 'all' not supported in CDI Lite

What it means

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.

Source

Thrown at independent-projects/arc/tcks/arquillian/src/main/java/io/quarkus/arc/arquillian/BeanArchive.java:82

        String content = bytes.toString(StandardCharsets.UTF_8);

        if (content.trim().isEmpty()) {
            return true;
        }

        if (content.contains("bean-discovery-mode='annotated'")
                || content.contains("bean-discovery-mode=\"annotated\"")) {
            return true;
        }

        if (content.contains("bean-discovery-mode='none'")
                || content.contains("bean-discovery-mode=\"none\"")) {
            return false;
        }

        if (content.contains("bean-discovery-mode='all'")
                || content.contains("bean-discovery-mode=\"all\"")) {
            throw new IllegalStateException("Bean discovery mode of 'all' not supported in CDI Lite");
        }

        // bean discovery mode not present, defaults to `annotated`
        return true;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Change bean-discovery-mode to 'annotated' in beans.xml
  2. Remove beans.xml entirely (defaults to annotated discovery)
  3. Add bean-defining annotations (@ApplicationScoped, etc.) to classes that relied on 'all' mode discovery
  4. Use 'none' only if you intentionally want no bean discovery for that archive

Example fix

// before
<beans xmlns="..." version="3.0" bean-discovery-mode="all">
// after
<beans xmlns="..." version="3.0" bean-discovery-mode="annotated">
Defensive patterns

Strategy: validation

Validate before calling

String content = Files.readString(beansXml);
if (content.contains("bean-discovery-mode=\"all\"") || content.contains("bean-discovery-mode='all'"))
    throw new IllegalStateException("Change to 'annotated' — CDI Lite does not support 'all'");

Try / catch

try { deploy(archive); }
catch (IllegalStateException e) { if (e.getMessage().contains("'all' not supported")) log.error("Fix beans.xml to use annotated discovery"); throw e; }

Prevention

When it happens

Trigger: Deploying an archive whose beans.xml contains bean-discovery-mode='all' (single or double quotes) when running against Quarkus/ArC.

Common situations: 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'.

Related errors


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