首页 文章

spring data redis / spring boot依赖不匹配?

提问于
浏览
0

我尝试将spring-data-redis 1.6.4.RELEASE中的Spring Boot应用程序升级到1.7.2.RELEASE,方法是将spring-data-redis依赖项添加到POM,同时保持spring-boot-starter-redis不变(使用Spring)启动1.3.5.RELEASE) . 升级的应用程序无法启动此错误:

引起:java.lang.AbstractMethodError:org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy $ CreateIfNotFoundQueryLookupStrategy.resolveQuery(Ljava / lang / reflect / Method; Lorg / springframework / data / repository / core / RepositoryMetadata; Lorg / springframework /数据/投影/ ProjectionFactory; Lorg / springframework的/数据/库/型芯/ NamedQueries)Lorg / springframework的/数据/库/查询/ RepositoryQuery;

有点神秘 .

1 回答

  • 0

    您需要升级所有Spring Data,而不仅仅是Spring Data Redis . 通过覆盖Spring Data Redis的版本,您将得到一个不兼容的Spring Data Commons版本 .

    在使用Spring Boot时,您应该将 spring-data-releasetrain.version 属性的版本覆盖为 Hopper-SR2

    <properties>
        <spring-data-releasetrain.version>Hopper-SR2</spring-data-releasetrain.version>
    </properties>
    

    并从已声明的任何与Spring Data相关的依赖项中删除该版本,以便Boot的依赖关系管理可以使它们保持一致 .

相关问题