黑马点评里的一点坑

jdk版本17,mybatis-plus版本3.4.3(课程提供的pom)

使用lamdaQuery:

User user = lambdaQuery().eq(User::getPhone, phone).one();

报错如下:

2024-04-17 21:40:56.653 ERROR 26564 --- [nio-8081-exec-1] com.hmdp.config.WebExceptionAdvice : org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere'. Cause: org.apache.ibatis.ognl.OgnlException: sqlSegment [java.lang.ExceptionInInitializerError]

查了好多,原因是高版本jdk不兼容低版本mybatis-plus

Mybatis-plus3.4.3下使用lambdaQuery报错_could not initialize class com.baomidou.mybatisplu-CSDN博客

解决方案:

  1. 降低jdk版本(不推荐)
  2. 使用mybatis-plus最新版,目前是:3.5.6


0个评论
点击登录,快来和大家讨论吧~
表情
图片
暂无评论
Galore
下载 APP