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
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
In this sample, in AOT mode, NoUniqueBeanDefinition is thrown for Validator beans, even though one of the two is annotated with @ConditionalOnMissingBean:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'integrationMessageHandlerMethodFactory': Unsatisfied dependency expressed through method 'messageHandlerMethodFactory' parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.validation.Validator' available: expected single matching bean but found 2: defaultValidator,mvcValidator
The text was updated successfully, but these errors were encountered:
snicoll
changed the title
@ConditionalOnMissingBean ignored for validator beans
PrimaryDefaultValidatorPostProcessor triggered at different time with AOT leads to incomplete Validator bean definition
Nov 9, 2021
The problem is a different order of processing for BeanDefinitionRegistryPostProcessor. I have changed a custom code to use a callback of framework and that fixed the issue. Unfortunately, calling these has the side effects of contributing quite some more bean definitions, certain with not the type I'd expect. I am investigating.
This was already fixed as part of #1213 but I've added a test to validate the behaviour. @OlgaMaciaszek your sample app still doesn't work unfortunately as Spring Integration is not yet supported.
Ok - the users will need to wait till that's done then for these kinds of projects. Anyway, that user-provided sample has allowed us to discover and fix at least 3 different issues :) . Thanks, @matus753.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In this sample, in AOT mode,
NoUniqueBeanDefinition
is thrown forValidator
beans, even though one of the two is annotated with@ConditionalOnMissingBean
:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'integrationMessageHandlerMethodFactory': Unsatisfied dependency expressed through method 'messageHandlerMethodFactory' parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.validation.Validator' available: expected single matching bean but found 2: defaultValidator,mvcValidator
The text was updated successfully, but these errors were encountered: