[英]Spring boot 2.2.4 release is not compatible with azure spring data cosmos 3.x.x
I'm working on springboot with cosmos api,So if i use @Query that is provided by azure-spring-data-cosmos library(3.xx) with Springboot 2.5.0 able to get the results from cosmos database.我正在使用 cosmos api 开发 springboot,所以如果我使用 azure-spring-data-cosmos 库 (3.xx) 提供的 @Query 和 Springboot 2.5.0 能够从 cosmos 数据库中获取结果。 But if i use the same azure-spring-data-cosmos library(3.xx) with springboot 2.2.4 getting below exception但是如果我使用相同的 azure-spring-data-cosmos 库(3.xx)和 springboot 2.2.4 得到以下异常
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.
I would highly recommend using the latest azure-spring-data-cosmos SDK version 3.19.0 - https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md#3190-2022-03-10我强烈建议使用最新的 azure-spring-data-cosmos SDK 版本 3.19.0 - https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring- data-cosmos/CHANGELOG.md#3190-2022-03-10
Since spring boot releases one major version every 6 months, azure spring team supports last 2 versions of Spring Boot.由于 spring 引导每 6 个月发布一个主要版本,azure spring 团队支持 Spring 引导的最后两个版本。 We currently support spring boot 2.5.x and 2.6.x.我们目前支持 spring 启动 2.5.x 和 2.6.x。 You should be able to use any one of these versions of spring-boot with latest version of azure-spring-data-cosmos SDK.您应该能够将 spring-boot 的任何一个版本与最新版本的 azure-spring-data-cosmos SDK 一起使用。
The changelog points to the compatible version of spring boot which can be used with azure-spring-data-cosmos SDK.变更日志指向 spring 启动的兼容版本,可与 azure-spring-data-cosmos SDK 一起使用。
Also, spring-boot 2.2.4 is more than 2 years old at this point of time.此外,此时 spring-boot 2.2.4 已超过 2 年。 We don't support it anymore.我们不再支持它了。
Not sure which version of cosmos you are using but cosmos change log clearly mentions that 3.5.0
has spring boot support 2.4.3
& above.不确定您使用的是哪个版本的 cosmos,但 cosmos 更改日志清楚地提到3.5.0
具有 spring 引导支持2.4.3
及更高版本。
Please check if your cosmos version is 3.5.0
which might be causing this issue.请检查您的 cosmos 版本是否为3.5.0
,这可能会导致此问题。
Reference link: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md#350-2021-03-11参考链接: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md#350-2021-03-11
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.