1、问题原因
发生这个问题就是因为Pagehelper中jsqlparser和Mybatis-puls中jsqlparser冲突,以我的项目来说,我项目中的Pagehelper中jsqlparser版本为4.2而Mybatis-puls中jsqlparser的版本为4.9,就导致版本兼容问题
2、解决方法
如果你想以Pagehelper中jsqlparser的版本来使用的话,那么项目将启动不起来,就比如拿我的项目来说,如果我在pom文件中添加
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>4.2</version>
</dependency>
那么项目则报错,会启动不了,所以解决方法不能以Pagehelper中jsqlparser的版本。
你可以提升一下pagehelper的版本 这是maven中央仓库Maven 存储库: com.github.pagehelper ? pagehelper-spring-boot-starter
但是中央仓库中pagehelper的最新版本中的jsqlparser也不是4.9,是4.7,
但是我在我的pom文件中添加了4.7的版本依赖问题解决了,可能4.7的版本可以和4.9的版本可以兼容吧
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>4.7</version>
</dependency>
我看网上其他的帖子都是推荐将MyBatis-Plus与PageHelper中的jsqlparser库排除后,再指定使用jsqlparser4.7
当然网上还有其他的方法,都可以试试