在使用PageHelper分页插件做模糊查询的分页现实时,遇到了异常该:
HTTP Status 500 - Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.apache.ibatis.reflection.MetaObject.forObject(Ljava/lang/Object;Lorg/apache/ibatis/reflection/factory/ObjectFactory;Lorg/apache/ibatis/reflection/wrapper/ObjectWrapperFactory;)Lorg/apache/ibatis/reflection/MetaObject;
而对查询所有分页就没问题,百度发现修改PageHelper分页插件版本可以解决问题。
1|发生异常情景
(maven项目,SSM框架,mysql8数据库)
PageHelper
版本3.7.2
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>3.7.2</version>
</dependency>
分页插件配置,在mybatis-config.xml中配置:
<plugins>
<!-- 分页插件 -->
<plugin interceptor="com.github.pagehelper.PageHelper">
<!-- 数据库类型 -->
<property name