[Solved] MySQL Error: “Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”

Project scene:

Recently, after deploying the project, an error occurred when running:

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘grades.order_id’ 
which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by

Problem Description

Using the GROUP BY statement violates sql_mode=only_full_group_by. Because the default mode after mysql version 5.7 is ONLY_FULL_GROUP_BY.


Cause Analysis:

Check the official documentation and find that starting from MySQL 5.7.5, the default SQL mode includes ONLY_FULL_GROUP_BY. (Before 5.7.5, MySQL did not detect functional dependencies, and ONLY_FULL_GROUP_BY was not enabled by default.) This may cause some sql statements to fail.


solution:

Execute the command vim /etc/mysql/conf.d/mysql.cnfto modify the configuration file

If there is sql_mode configuration in my.cnf, remove ONLY_FULL_GROUP_BY.

If not, put the following content in the corresponding place

[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
BASHcopyfull screen

After saving, execute the command to service mysql restartrestart mysql.

[Solved] Arm Server kibana7.4.1 Error: Sending Logstash logs to /home/logstash-6.8.4/logs which is now configured via log4j2.properties

Problem description: Start kibana7.4.1 on the Arm server and report Sending Logstash logs to /home/logstash-6.8.4/logs which is now configured via log4j2.properties
[2019-12-02T14:13:48,010][ERROR][ org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (LoadError) load error: ffi/ffi — java.lang.NullPointerException: null

Cause of the problem: lib/ruby/stdlib/ffi/platform/aarch64-linux/ needs to be missing the platform.conf file, resulting in an abnormal code error

Solution: Copy lib/ruby/stdlib/ffi/platform/aarch64-linux/types.conf and re-command to platform.conf, and repackage jruby-complete-9.2.7.0.jar:

cd /opt/logstash-6.8.4/logstash-core/lib/jars
mkdir -p jruby-complete-9.2.7.0
mv jruby-complete-9.2.7.0.jar jruby-complete-9.2.7.0.jar_bak
cp jruby-complete -9.2.7.0.jar jruby-complete-9.2.7.0/
cd jruby-complete-9.2.7.0/
unzip jruby-complete-9.2.7.0.jar
cd logstash-core/lib/jars/jruby-complete-9.2.7.0/ META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/aarch64-linux
cp types.conf platform.conf
cd /opt/logstash-6.7.4/logstash-core/lib/jars/jruby-complete- 9.2.7.0/
rm jruby-complete-9.2.7.0.jar
zip -r jruby-complete-9.2.7.0.jar *
mv jruby-complete-9.2.7.0.jar ../

Start Logstash:
./logstash -e ‘input { stdin { } } output { stdout {} }’

[Solved] Vivado Error: vivado 12-8300 launch hls failed please see vivado hls.log for details

Error Messages:

Solution:

1. Download the "y2k22_patch-1.2.zip" file attached to this page
2. Unzip the file into the installation root location
Default Windows installation location C:\Xilinx
Default Linux installation location: /opt/Xilinx or /tools/Xilinx
Note: While extracting this patch on Windows, make sure that the destination folder does not contain the Zip file name (y2k22_patch-1.2.zip). For example, if the installation root is C:\Xilinx make sure that after the extraction the y2k22_patch folder is under C:\Xilinx, i.e : C:\Xilinx\y2k22_patch
3. Open the README and follow the instructions for the specific version you are applying the patch to.
4. A successful output of the script will look like the following for each version of the tool it is being applied to:
[2022-01-07] INFO: This script (version: 1.2) patches Xilinx Tools for HLS Y2k22 bug for the following release:
2014.*, 2015.*, 2016.*, 2017.*, 2018.*, 2019.*, 2020.* and 2021.*
[2022-01-07] UPDATE: /tools/xilinx/Vivado/2021.1/common/scripts
[2022-01-07] COPY: /tools/xilinx/y2k22_patch/automg_patch_20220104.tcl  to
/tools/xilinx/Vivado/2021.1/common/scripts/automg_patch_20220104.tcl
[2022-01-07] UPDATE: /tools/xilinx/Vitis_HLS/2021.1/common/scripts
[2022-01-07] COPY: /tools/xilinx/y2k22_patch/automg_patch_20220104.tcl  to 
/tools/xilinx/Vitis_HLS/2021.1/common/scripts/automg_patch_20220104.tcl
 

The screen print information after the patch is executed in the ubuntu18.04 vitis2021.1 environment:

[Solved] jhat Analyzes dump File Error: java.lang.OutOfMemoryError

1. Problems and phenomena

There is a dump file with a size of 14G, which is analyzed by the jhat tool

error out of memory

Reading from gl.hprof...
Dump file created Wed Jun 08 17:56:28 CST 2022
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.util.Hashtable.addEntry(Hashtable.java:436)
	at java.util.Hashtable.put(Hashtable.java:477)
	at com.sun.tools.hat.internal.model.Snapshot.addHeapObject(Snapshot.java:166)
	at com.sun.tools.hat.internal.parser.HprofReader.readInstance(HprofReader.java:744)
	at com.sun.tools.hat.internal.parser.HprofReader.readHeapDump(HprofReader.java:491)
	at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:275)
	at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:92)
	at com.sun.tools.hat.Main.main(Main.java:159)
[root@nccztsjb-node-27 data]# netstat -ntlp

I changed a host with 32G memory, and the execution still reported an error of memory overflow. I was thinking about whether the jhat tool itself has a memory limit…  

2. Solution

Increase the memory used by jhat

jhat -J-mx20g gl.hprof

Use -J to specify the size of the memory. [-J-mx20g]

[Solved] IDEA JPA Custome Query Error: Can‘t resolve symbol ‘Type‘

I encountered a problem when doing project design today.

Problem found:insert image description here
As shown in the figure above, use the JPA annotation @Query to customize the query, and report the error Can’t resolve symbol ‘Type’.

Solve problem 1 – not Working:
I checked a lot of information on the Internet and said that you can follow the following
File -> Project Structure -> Facets -> JPA -> select the ” + ” sign in the lower right corner -> persistence.xml

As shown in the figure below:
insert image description here
After adding, it may still report an error. Continue the following operations: File -> Invalidate Caches/Restart, which is actually to clear the cache and restart.
But after restarting it still reported the same error.

Solve problem 2 – it works

  • The writing method of the JPA statement under the @Query annotation is different from the native SQL statement. select t from Type tIt means to query all data from the table maintained by the Type entity class (using JPA to maintain the database table through the entity class, so you can query the data in the corresponding table through the Type entity class).
  • select entity class name from entity class entity class name.
  • But the reason for the error here is actually a problem with the Hibernate mapping relationship. The from Xxx used in the hql query, Xxx is not the name of the entity class, but the EntityName (Hibernate annotation). If the EntityName is not explicitly specified after @Entity, the name of the entity class is used by default; if the EntityName is explicitly specified, when using hql query, the from EntityName should be used instead of the from entity class name.
  • In my code, there are entity classes Tag, Type, Blog, etc., but the annotations all specify @Entity(name=”t_type”), etc., so the following methods should be used in the Dao layer:
@Query("select t from t_type t")
List<Type> findTop(Pageable pageable);

The following is a screenshot of some code annotations in the entity class
insert image description here

insert image description here
insert image description here

[Solved] pagehelper Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 1’

Project name: ssm_test
Problem description: When using pagehelper, an error is reported You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘LIMIT 1’
Solution: in the xxxmapper.xml file There is one more semicolon in the query statement, just delete
it. Reason: Because the PageHelper plugin will splicing limit after the query statement, resulting in an error

<select id="getById" resultMap="goodsResultMap">
        select * from tbl_goods;limit 1,5;
    </select>

[Solved] Violation of check constraint (GYPTS.SYS_C0016857)

Error Messages:

Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-02290: Violation of check constraint (GYPTS.SYS_C0016857)

 

Reason:

Previously, the field PLANT_USER cannot be null was changed to null, but in the check, the PLANT_USER cannot be null will still be checked, so an error will be reported.

 

Solution:

Remove the checkmark.

 

[Solved] There is no getter for property named ‘distinct’ in…

Cause Analysis:

The parameter passed by the selectByExample() method is wrong, the example type should be passed, not the entity class.

The error code is as follows:

@Override
    public PlantGrow selectPlantGrow(PlantGrow plantGrow1) {
        List<PlantGrow> plantGrows = plantGrowMapper.selectByExample(plantGrow1);
        if (!CollectionUtils.isEmpty(plantGrows)) {
            return plantGrows.get(0);
        }
        return null;
    }

Solution: Modify to select.

[Solved] java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell

Error Message:

Exception in thread "main" java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell
 at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:1050)
 at org.apache.poi.xssf.usermodel.XSSFCell.getRichStringCellValue(XSSFCell.java:404)
 at org.apache.poi.xssf.usermodel.XSSFCell.getRichStringCellValue(XSSFCell.java:70)
 at com.jawasoft.testDemo.ExcelUtil.readExcel(ExcelUtil.java:81)
 at com.jawasoft.testDemo.ExcelUtil.readExcelToObj(ExcelUtil.java:46)
 at com.jawasoft.testDemo.ExcelUtil.main(ExcelUtil.java:29)

Reason for error: When reading the cell string, there is data of type number, so it needs to be converted into pure String type, so that no error will be reported.

Error code:

returnStr = cell.getRichStringCellValue().getString();

or the following code

// Get cell data 
String cellValue = cell.getStringCellValue();

Solution: Set the cell type to String before reading the excel cell data conversion

code show as below:

//set cell type
cell.setCellType(CellType.STRING); 
returnStr = cell.getRichStringCellValue().getString();

[Solved] the request was rejected because its size (11579386) exceeds the configured maximum (10485760)

1. Message Error:

org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (11579386) exceeds the configured maximum (10485760)
    at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:805) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.Request.parseParts(Request.java:2846) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.Request.parseParameters(Request.java:3185) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.Request.getParameter(Request.java:1116) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:84) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_301]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_301]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]

2. Reason

Because the default configuration of springboot multipart.max-file-size is 1M and max-request-size is 10M

3. Solution

Add the following codes in application.yml:

spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=500MB

Note: Don’t miss the unit (KB, MB, GB, etc.)

[Solved] SAX2 driver class org.apache.xerces.parsers.SAXParser not found

1. Error Messages:

org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
    at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230) ~[?:1.8.0_301]
    at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:221) ~[?:1.8.0_301]
    at cn.afterturn.easypoi.excel.imports.sax.SaxReadExcel.fetchSheetParser(SaxReadExcel.java:96) ~[easypoi-base-4.2.0.jar:?]
    at cn.afterturn.easypoi.excel.imports.sax.SaxReadExcel.readExcel(SaxReadExcel.java:71) [easypoi-base-4.2.0.jar:?]
    at cn.afterturn.easypoi.excel.imports.sax.SaxReadExcel.readExcel(SaxReadExcel.java:55) [easypoi-base-4.2.0.jar:?]
    at com.zwh.util.ExcelUtils.importExcelBySax(ExcelUtils.java:254) [classes/:?]
    at com.zwh.util.ExcelUtils.importExcelBySax(ExcelUtils.java:246) [classes/:?]
    at com.zwh.util.ExcelUtils.importExcelBySax(ExcelUtils.java:230) [classes/:?]
    at com.zwh.service.TestService.upload(TestService.java:28) [classes/:?]
    at com.zwh.controller.TestController.upload(TestController.java:46) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:215) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:142) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:901) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_301]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_301]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:70) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138) ~[tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82) ~[?:1.8.0_301]
    at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228) ~[?:1.8.0_301]
    ... 63 more

2022-06-09 11:08:28.516 ERROR 20368 --- [nio-8888-exec-2] c.a.e.e.i.s.SaxReadExcel                 : SAX failed to import datas

cn.afterturn.easypoi.exception.excel.ExcelImportException: SAX failed to import datas
    at cn.afterturn.easypoi.excel.imports.sax.SaxReadExcel.readExcel(SaxReadExcel.java:90) ~[easypoi-base-4.2.0.jar:?]
    at cn.afterturn.easypoi.excel.imports.sax.SaxReadExcel.readExcel(SaxReadExcel.java:55) [easypoi-base-4.2.0.jar:?]
    at com.zwh.util.ExcelUtils.importExcelBySax(ExcelUtils.java:254) [classes/:?]
    at com.zwh.util.ExcelUtils.importExcelBySax(ExcelUtils.java:246) [classes/:?]
    at com.zwh.util.ExcelUtils.importExcelBySax(ExcelUtils.java:230) [classes/:?]
    at com.zwh.service.TestService.upload(TestService.java:28) [classes/:?]
    at com.zwh.controller.TestController.upload(TestController.java:46) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:215) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:142) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:901) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) [spring-webmvc-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar:5.1.2.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_301]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_301]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.12.jar:9.0.12]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]

2022-06-09 11:08:28.523 ERROR 20368 --- [nio-8888-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is cn.afterturn.easypoi.exception.excel.ExcelImportException: SAX failed to import datas] with root cause

2. Solution

Add the dependency org.apache.xerces.parsers.SAXParser

<dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.9.1</version>
        </dependency>