当前使用版本(必填,否则不予处理)
implementation 'com.baomidou:mybatis-plus-boot-starter:3.3.2'
该问题是如何引起的?(确定最新版也有问题再提!!!)
LambdaQueryWrapper<Template> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(Template::getSystemId, "xxx");
lambdaQueryWrapper.eq(Template::getBussinessUnit, "xxx");
lambdaQueryWrapper.eq(Template::getMessageType, "xxx");
重现步骤(如果有就写完整)
报错信息
2021-11-02 13:45:15.922 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is 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.NullPointerException: Cannot invoke "java.lang.Object.hashCode()" because "<parameter1>" is null]] with root cause
java.lang.NullPointerException: Cannot invoke "java.lang.Object.hashCode()" because "<parameter1>" is null
at java.base/java.util.concurrent.ConcurrentHashMap.get(Unknown Source) ~[na:na]
at com.baomidou.mybatisplus.core.toolkit.LambdaUtils.resolve(LambdaUtils.java:62) ~[mybatis-plus-core-3.3.2.jar!/:3.3.2]
Comment From: ncc0706
解决方案: 去除spring-boot-maven-plugin插件进行打包或升级至3.3.2
此时需要注意 jre 的版本,生产环境刚好用到 openjdk16-openj9 这个版本会提示上面的错误。
建议使用 openjdk