You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!requiredClazz.method(val.name()).hasAnnotation(DotNames.NONBINDING)
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: java.lang.NullPointerException: Cannot invoke "org.jboss.jandex.ClassInfo.method(String, org.jboss.jandex.Type[])" because "requiredClazz" is null
at io.quarkus.arc.processor.Beans.hasQualifier(Beans.java:684)
Expected behavior
No NPE and as much as possible, a meaningfull error message.
Actual behavior
Inspecting beanDeployment.beanArchiveImmutableIndex, it contains only the qualifier of the second bean, so something seems to have added it automatically (maybe because it is used in the app project), but not the required one.
If hasQualifier return false when requiredClazz is null, then, I have an more descriptive error but it is still meaningless.
Caused by: jakarta.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type software.amazon.awssdk.services.sqs.SqsClientBuilder and qualifiers [@io.quarkus.amazon.common.AmazonClientBuilder("test")]
- synthetic injection point
- declared on SYNTHETIC bean [types=[software.amazon.awssdk.services.sqs.SqsClient, java.lang.Object], qualifiers=[@Any, @io.quarkus.amazon.common.AmazonClient("test")], target=n/a]
The following beans match by type, but none has matching qualifiers:
- SYNTHETIC bean [types=[java.lang.Object, software.amazon.awssdk.services.sqs.SqsClientBuilder], qualifiers=[@io.quarkus.amazon.common.AmazonClientBuilder("test"), @Any], target=n/a]
- SYNTHETIC bean [types=[java.lang.Object, software.amazon.awssdk.services.sqs.SqsClientBuilder], qualifiers=[@Default, @Any], target=n/a]
I'm wondering why io.quarkus.amazon.common.AmazonClient is a known qualifier and io.quarkus.amazon.common.AmazonClientBuilder is not.
Why ArcProcessor knows about the qualifier as the error message shows it and we still need to register the annotation manually for AdditionalBeanBuildItem.
Could it be possible to add a message when requiredClazz is null that tells that a qualifier should be registered manually ?
How to Reproduce?
No response
Output of uname -a or ver
No response
Output of java -version
No response
Quarkus version or git rev
3.11
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Inspecting beanDeployment.beanArchiveImmutableIndex, it contains only the qualifier of the second bean, so something seems to have added it automatically (maybe because it is used in the app project), but not the required one.
Arc does some best effort to automatically add encountered missing classes to the index if they are used by beans which might be the case here. Hard to say without a reproducer, but assuming both qualifiers reside in the same project, that would be my guess.
Why ArcProcessor knows about the qualifier as the error message shows it and we still need to register the annotation manually for AdditionalBeanBuildItem.
It only knows of its DotName representation but the actual class isn't present in the index - think of it as knowing the String representation of the class but not having access to the actual Class reference.
Could it be possible to add a message when requiredClazz is null that tells that a qualifier should be registered manually ?
We could add a null check with an exception saying it has not been indexed although the cause for that isn't necessarily missing manual registration so the message would have to be more broad.
Describe the bug
Don't know if this expected but the experience may be improved as it is the second time I lost some time finding out what was going on.
I was trying to register two synthetic beans
SqsClientBuilder
andSqsClient
. The second one having an injection point of the first one with a custom qualifier. Both beans have a custom qualifier. Those qualifiers were not register as per documented https://quarkus.io/guides/cdi-integration#use-case-my-annotation-is-not-recognized-as-a-qualifier-or-an-interceptor-binding.I got an NPE because
requiredClazz
is null here for the first qualifier.quarkus/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Beans.java
Line 684 in 542f553
Expected behavior
No NPE and as much as possible, a meaningfull error message.
Actual behavior
Inspecting
beanDeployment.beanArchiveImmutableIndex
, it contains only the qualifier of the second bean, so something seems to have added it automatically (maybe because it is used in the app project), but not the required one.If
hasQualifier
return false whenrequiredClazz
is null, then, I have an more descriptive error but it is still meaningless.I'm wondering why
io.quarkus.amazon.common.AmazonClient
is a known qualifier andio.quarkus.amazon.common.AmazonClientBuilder
is not.Why ArcProcessor knows about the qualifier as the error message shows it and we still need to register the annotation manually for AdditionalBeanBuildItem.
Could it be possible to add a message when
requiredClazz
is null that tells that a qualifier should be registered manually ?How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.11
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: