使用pagehelper插件时异常
5.0之后的版本使用com.github.pagehelper.PageInterceptor这个类
即改为:
<plugin interceptor="com.github.pagehelper.PageInterceptor">
再次报错:
Cause: com.github.pagehelper.PageException: java.lang.ClassNotFoundException: mysql
原因:4.0.0以后的版本已经可以自动识别数据库了,所以不需要我们再去指定数据库
注掉 <property name="dialect" value="mysql"/>
项目成功启动
补充:
用下面的会报错:在系统中发现了多个分页插件,请检查系统配置!
<artifactId>pagehelper-spring-boot-starter</artifactId>
需将pom依赖换成
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.4</version>
</dependency