quarkusio/quarkus · error · IllegalStateException

No bean type found for

Error message

No bean type found for: ${bean}

What it means

During ComponentsProvider generation, each bean must map to a generated bean class name (beanToGeneratedName). If a bean in a group has no entry — meaning no bean type class was generated for it — code generation cannot emit the addBean call and fails fast with IllegalStateException. This is an internal generator invariant, typically indicating a bug or inconsistent state upstream.

Solutions

  1. Clean rebuild (mvn clean install) to regenerate ArC components and clear stale state
  2. Check the extension registering the bean ensures it contributes a proper bean type/generated class
  3. Report/inspect as a possible ArC bug if reproducible on a minimal project; try a different Quarkus version

Example fix

null
Defensive patterns

Strategy: try-catch

Try / catch

try {
    quarkusBuild.start();
} catch (IllegalStateException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("No bean type found for:")) {
        logger.errorf("Clean rebuild or report ArC bug: %s", e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: generateAddBeans iterates group.beans() and calls beanToGeneratedName.containsKey(bean); a bean is absent from the map so beanType is null and the IllegalStateException is thrown.

Common situations: Custom extensions registering synthetic beans in unusual ways that skip bean-type generation; ArC processor bugs after Quarkus upgrades; build caches holding stale generated metadata after refactors.

Related errors


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

Appendix: source

Thrown at independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ComponentsProviderGenerator.java:297

    private void generateAddBeans(String generatedName, Gizmo gizmo, CodeGenInfo info,
            Map<BeanInfo, String> beanToGeneratedName) {
        Set<BeanInfo> processed = new HashSet<>();

        for (Container<BeanGroup> container : info.beans()) {
            gizmo.class_(container.className(generatedName, ADD_BEANS), cc -> {
                cc.final_();
                for (BeanGroup group : container) {
                    cc.staticMethod(ADD_BEANS + group.id(), mc -> {
                        mc.packagePrivate();
                        mc.returning(void.class);
                        ParamVar beanIdToBean = mc.parameter("beanIdToBean", Map.class);
                        mc.body(bc -> {
                            for (BeanInfo bean : group.beans()) {
                                ClassDesc beanType = beanToGeneratedName.containsKey(bean)
                                        ? ClassDesc.of(beanToGeneratedName.get(bean))
                                        : null;
                                if (beanType == null) {
                                    throw new IllegalStateException("No bean type found for: " + bean);
                                }

                                List<InjectionPointInfo> injectionPoints = bean.getInjections()
                                        .stream()
                                        .flatMap(i -> i.injectionPoints.stream())
                                        .filter(ip -> !ip.isDelegate() && !BuiltinBean.resolvesTo(ip))
                                        .toList();
                                List<ClassDesc> params = new ArrayList<>();
                                List<Expr> args = new ArrayList<>();

                                if (bean.isProducer()) {
                                    params.add(ClassDesc.of(Supplier.class.getName()));
                                    if (processed.contains(bean.getDeclaringBean())) {
                                        args.add(bc.withMap(beanIdToBean)
                                                .get(Const.of(bean.getDeclaringBean().getIdentifier())));
                                    } else {
                                        // Declaring bean was not processed yet - use MapValueSupplier
                                        args.add(bc.new_(MethodDescs.MAP_VALUE_SUPPLIER_CONSTRUCTOR, beanIdToBean,

View on GitHub (pinned to e1c734241f)