Solution:
将各组件版本调整为如下所示:
Spring Cloud:Hoxton.SR5;
Spring Boot:2.2.12.RELEASE;
spring-cloud-alibaba-dependencies:2.2.1.RELEASE;
aliyun-oss-spring-boot-starter:1.1.0;
MyBatis Plus:3.4.1;
JDK:11.0.9;
Nacos:1.4.0。
不当的组件版本组合为:
Spring Cloud:Hoxton.SR8;
Spring Boot:2.3.7.RELEASE;
spring-cloud-alibaba-dependencies:2.2.1.RELEASE;
aliyun-oss-spring-boot-starter:1.1.0;
MyBatis Plus:3.3.1;
JDK:11.0.9;
Nacos:1.4.0。
The main code of MBP's paging component is as follows:
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作,true为调回到首页,false为继续请求。默认为false。
// paginationInterceptor.setOverflow(false);
paginationInterceptor.setOverflow(true);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
// paginationInterceptor.setLimit(500);
paginationInterceptor.setLimit(1000);
// 开启count的join优化,只针对部分left join(本文问题原因所在!):
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
return paginationInterceptor;
}
When a query request is sent due to improper version matching, the backend console exception is as follows:
2021-01-30 02:01:43.885 DEBUG 51272 --- [io-11000-exec-1] c.e.b.xx.dao.xxx.selectPage : ==> Preparing: SELECT COUNT(1) FROM test
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffdfa599b1f, pid=51272, tid=52324
#
# JRE version: Java(TM) SE Runtime Environment 18.9 (11.0.9+7) (build 11.0.9+7-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM 18.9 (11.0.9+7-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# V [jvm.dll+0x1f9b1f]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\***\hs_err_pid51272.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
A great master once said that incorrect version matching may produce some inexplicable abnormalities. This time I really learned the lesson!
I searched for a long time but found no clues to the problem. Once when I was looking at the Project Structure, I accidentally saw the version information of MyBatis-Plus, which was inconsistent with the versions of other services in my memory. After comparison, the difference was finally discovered.