08-02-2023, 02:44 PM
I've reproduced similar issue in multi-module project w/ `No qualifying bean of type` like:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.stockclient.repository.StockPriceRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
and the reason for this error was missing annotation `@EnableJpaRepositories` in my specific use case.
**To clarify:** this annotation needs to be added for enabling auto configuration support for `Spring Data JPA` required to know the path of `JPA` repositories. By default, it will scan only the main application package and its sub packages for detecting the `JPA` repositories.
For more details you can refer, for instance, to this [article][1].
[1]:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.stockclient.repository.StockPriceRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
and the reason for this error was missing annotation `@EnableJpaRepositories` in my specific use case.
**To clarify:** this annotation needs to be added for enabling auto configuration support for `Spring Data JPA` required to know the path of `JPA` repositories. By default, it will scan only the main application package and its sub packages for detecting the `JPA` repositories.
For more details you can refer, for instance, to this [article][1].
[1]:
[To see links please register here]