quarkusio/quarkus · error · UnsatisfiedResolutionException

No bean found for required type [

Error message

No bean found for required type [

What it means

Instance.get()/getHandle()/getInternal() resolve the required type+qualifiers against the container's beans. If no bean matches, ArC first triggers scanRemovedBeans (which produces a helpful hint if the bean existed at build time but was removed) and then throws UnsatisfiedResolutionException('No bean found for required type [...] and qualifiers [...]').

Source

Thrown at independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/InstanceImpl.java:288

                try {
                    return bean.get(context);
                } finally {
                    if (resetCurrentInjectionPoint) {
                        InjectionPointProvider.setCurrent(context, prev);
                    }
                }
            }
        },
                // If @Dependent we need to remove the instance from the CC of this InjectableInstance
                Dependent.class.equals(bean.getScope()) ? this::destroy : null);
    }

    @SuppressWarnings("unchecked")
    private InjectableBean<T> bean() {
        List<InjectableBean<?>> beans = beans();
        if (beans.isEmpty()) {
            ArcContainerImpl.instance().scanRemovedBeans(requiredType, requiredQualifiers.toArray(new Annotation[] {}));
            throw new UnsatisfiedResolutionException(
                    "No bean found for required type [" + requiredType + "] and qualifiers [" + requiredQualifiers + "]");
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("Beans: " + beans.toString());
        }
        return (InjectableBean<T>) beans.iterator().next();
    }

    public boolean hasDependentInstances() {
        return creationalContext.hasDependentInstances();
    }

    @Override
    public void clearCache() {
        if (cachedGetResult.isSet()) {
            creationalContext.release();
            cachedGetResult.clear();
        }
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Verify the target class is a discoverable bean (@ApplicationScoped etc.) and in a package that is indexed (beans.xml discovery, Jandex)
  2. Add @Unremovable or quarkus.arc.unremovable-types=<type> if ArC's unused-bean removal removed it
  3. Check log output near startup for 'removed beans' hints ArC prints via scanRemovedBeans and follow the suggestion
  4. Fix the required type/qualifiers passed to select() so they match the bean's type and binding annotations

Example fix

// before
instance.select(MissingService.class, new Exact.Literal()).get(); // UnsatisfiedResolutionException
// after
deployment: @ApplicationScoped public class MissingService { ... } // ensure bean is registered and not removed
Defensive patterns

Strategy: validation

Validate before calling

static <T> T getOrThrow(Instance<T> instance, Class<T> type) {
    if (instance.isUnsatisfied()) {
        throw new IllegalStateException("No bean for " + type + " — check @Unremovable and bean discovery");
    }
    return instance.get();
}

Type guard

static <T> boolean resolvable(Instance<T> i) {
    return !i.isUnsatisfied() && !i.isAmbiguous();
}

Try / catch

try {
    svc = instance.select(PaymentService.class, qualifier).get();
} catch (UnsatisfiedResolutionException e) {
    log.errorf("Bean %s missing or was removed as unused; add @Unremovable", PaymentService.class);
    throw e;
}

Prevention

When it happens

Trigger: Calling instance.get()/instance.getHandle() where no bean of requiredType (with the given qualifiers) is registered — the class was never discovered as a bean, is excluded by a build-time condition, or the qualifiers don't match.

Common situations: Missing @Inject/@Unremovable on a bean removed as unused by ArC's unused-bean removal; typo in qualifier; type changed (interface vs impl) after a refactor; bean only registered in a different profile or test slice.

Related errors


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