baomidou / mybatis-plus

An powerful enhanced toolkit of MyBatis for simplify development
https://baomidou.com
Apache License 2.0
16.41k stars 4.31k forks source link

集成 PaginationInnerInterceptor后报错 #6213

Closed chaobingliu closed 5 months ago

chaobingliu commented 5 months ago

当前使用版本 3.5.6 当前环境信息 例如: Java8 + Mysql5.7

描述bug现象 当加入PaginationInnerInterceptor拦截器后,应用启动报错。当去掉这个拦截器后,应用正常启动。

提供问题复现步骤

添加拦截器的代码如下: MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); configuration.addInterceptor(interceptor);

提供完整堆栈日志(可选) ERROR SpringApplication Application run failed java.lang.InstantiationError: net.sf.jsqlparser.statement.select.SelectItem at com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor.(PaginationInnerInterceptor.java:69) at cn.cncc.cjdp5.AfterIocInitialConfig.run(AfterIocInitialConfig.java:31) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:782) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:766) at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) at cn.IaicsApplication.main(IaicsApplication.java:20) 五月 28, 2024 8:57:01 下午 org.apache.coyote.AbstractProtocol pause 提供问题复现工程(可选) 请尽量提供复现工程,减少大家排错的时间.

miemieYaho commented 5 months ago

检查你jsqlparser依赖冲突

CrazyBuug commented 5 months ago

检查下你的PageHelper代入的jsqlparder的版本是否低于4.9,建议exclude掉,直接用mybatis-plus3.5.6引入的4.9版本,我这样修改完后启动正常