diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java index d0d87e32b1d79b..b5eb22584600c4 100644 --- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java +++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java @@ -680,6 +680,12 @@ static boolean hasQualifier(BeanDeployment beanDeployment, AnnotationInstance re //as this is called in a tight loop we only do it if necessary values = new ArrayList<>(); Set nonBindingFields = beanDeployment.getQualifierNonbindingMembers(requiredQualifier.name()); + if (requiredClazz == null) { + throw new IllegalStateException("Failed to find bean qualifier class with name " + + requiredQualifier.name() + " in application index. Make sure the class is part of " + + "the Jandex index. Classes that are not subject to discovery can be registered via " + + "AdditionalBeanBuildItem and non-qualifier annotations can use QualifierRegistrarBuildItem"); + } for (AnnotationValue val : requiredQualifier.valuesWithDefaults(beanDeployment.getBeanArchiveIndex())) { if (!requiredClazz.method(val.name()).hasAnnotation(DotNames.NONBINDING) && !nonBindingFields.contains(val.name())) {