-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qualifiers registered programmatically are not supported by AOT #30410
Comments
To be checked if #29709 is related or not. |
Static qualifiers are supported as you've found out. We haven't had a use case of something like this being set programmatically. Thanks for the reproducer! |
It looks like we should support a form of |
This commit handles AutowiredCandidateQualifier instances, rather than relying on qualifiers being statically defined and meta-annotated with `@Qualifier`. Closes spring-projectsgh-30410
I think I have a fix for this with snicoll@2f41ce6. Building your reproducer with it adds the following line to the bean definition. beanDefinition.addQualifier(new AutowireCandidateQualifier("com.example.demo.GrpcSpringClient", "myclient")); I'd like to spend a bit more time on what we do for |
Qualifiers aren't captured by AOT in the generated
BeanDefinitions
classes, leading to failures when running under AOT:In our specific case, they're custom qualifier annotations and definitions registered by a registry post-processor. It appears for simple annotated
Qualifier
beans, the framework is able to fallback and infer the qualifier.Example project:
https://github.com/DanielThomas/spring-aot-issues/tree/dannyt/qualifier-missing
Run and note the failure:
The text was updated successfully, but these errors were encountered: