mybatis-config.xml 配置了一下内容
<plugins>
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="dialect" value="mysql"/>
<property name="offsetAsPageNum" value="false"/>
<property name="rowBoundsWithCount" value="false"/>
<property name="pageSizeZero" value="true"/>
<property name="reasonable" value="false"/>
<property name="supportMethodsArguments" value="false"/>
<property name="returnPageInfo" value="none"/>
</plugin>
</plugins>
然后就报错:
Error parsing SQL Mapper Configuration. Cause: java.lang.ClassCastException:
com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor
经过分析发现,我使用的分页插件版本是5.1.2,而4.0.0以后的版本配置为:
<plugin interceptor="com.github.pagehelper.PageInterceptor">
</plugin>