mybatis-plus 版本不兼容问题的解决

来自:互联网
时间:2020-09-25
阅读:

mybatis-plus 版本不兼容问题

1,mybatis-plus 版本中存在一个问题。
2,mybatis-plus-extension 版本为v3.2.1.1-SNAPSHOT 以上版本时使用其PaginationInterceptor分页插件时。
3,mybatis-plus-core 版本也需要升级到v3.2.1.1-SNAPSHOT以上。
4,因为在PaginationInterceptor类中

mybatis-plus 版本不兼容问题的解决

此位置使用了mybatis-plus-core包中toolkit/StringUtils工具类中的isNotBlank(),但是低版本中缺乏isNotBlank()方法。

5,会造成使用PaginationInterceptor进行分页时报如下异常:

org.springframework.web.util.NestedServletException: Handler dispatch fAIled; nested exception is java.lang.NoSuchMethodError: com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(Ljava/lang/CharSequence;)Z

mybatis-plus 版本不兼容问题的解决

所以在使用PaginationInterceptor分页插件时需要将pom版本更新至v3.2.1.1-SNAPSHOT版本以上
mybatis-plus-core v3.2.1.1-SNAPSHOT
mybatis-plus-extension v3.2.1.1-SNAPSHO

返回顶部
顶部