首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >org.springframework.data.domain.Sort.by(sort.direction,字符串:java.lang.NoSuchMethodError)

org.springframework.data.domain.Sort.by(sort.direction,字符串:java.lang.NoSuchMethodError)
EN

Stack Overflow用户
提问于 2022-09-14 16:31:20
回答 1查看 74关注 0票数 0

在尝试调用我的方法时获得以下错误: org.springframework.data.domain.Sort.by(Lorg/springframework/data/domain/Sort$Direction;[Ljava/lang/String;)Lorg/springframework/data/domain/Sort;:findAll( recordLimit,recordOffset,Sort.by(DESC,MODIFIED_DATE))

使用SpringData-Commons-2.1.3 RELEASE.jar

以下是pom的相关部分:

代码语言:javascript
复制
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons</artifactId>
    <version>2.1.3.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons-core</artifactId>
    <version>1.4.1.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
</dependency>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-14 19:47:00

您指的是spring-data-commonsspring-data-commons-core,后者非常非常老。它有一个冲突的类Sort,它是在运行时使用的,而不是您希望/需要从spring-data-commons获得的类。

删除对spring-data-commons-core和重新构建的依赖关系。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73720328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档