I'm working on springboot with cosmos api,So if i use @Query that is provided by azure-spring-data-cosmos library(3.x.x) with Springboot 2.5.0 able to get the results from cosmos database. But if i use the same azure-spring-data-cosmos library(3.x.x) with springboot 2.2.4 getting below exception
Field userRepository in com.example.service.UserService required a bean of type 'com.example.repository.UserRepository' that could not be found.The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:Consider defining a bean of type 'com.example.repository.UserRepository' in your configuration.
Not sure which version of cosmos you are using but cosmos change log clearly mentions that
3.5.0
has spring boot support2.4.3
& above.Please check if your cosmos version is
3.5.0
which might be causing this issue.Reference link : https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md#350-2021-03-11