I am trying to start a springboot application where this annotation has been used. When I try to start the application it gives me the following error:
<
You should not skip the part of the documentation that clearly says:
The condition can only match the bean definitions that have been processed by the application context so far and, as such, it is strongly recommended to use this condition on auto-configuration classes only.
It goes on later to say:
If a candidate bean may be created by another auto-configuration, make sure that the one using this condition runs after
In rather simple words it might mean that the @Bean brought in by the some other auto-configuration should take precedence over the one that you defined. For that to work, you need to properly set-up the order of those configurations via @AutoConfigureBefore.