2021-09-08 使用easyexcel解析几十万条数据时报错

使用easyexcel上传几万条数据正常,解析几十万条数据时报了如下错误:

com.alibaba.excel.exception.ExcelAnalysisException: java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.excel.cache.Ehcacheat com.alibaba.excel.analysis.ExcelAnalyserImpl.<init>(ExcelAnalyserImpl.java:57)at com.alibaba.excel.ExcelReader.<init>(ExcelReader.java:145)at com.alibaba.excel.read.builder.ExcelReaderBuilder.build(ExcelReaderBuilder.java:193)at com.haiyisoft.eCodeBank.eCodeBankService.common.GlobFunc.getPgFileLines(GlobFunc.java:873)at com.haiyisoft.eCodeBank.eCodeBankService.common.GlobFunc.getPgLines(GlobFunc.java:908)at com.haiyisoft.eCodeBank.eCodeBankService.cap.service.impl.CapUpBatchServiceImpl.insert(CapUpBatchServiceImpl.java:152)at com.haiyisoft.eCodeBank.eCodeBankService.cap.service.impl.CapUpBatchServiceImpl$$FastClassBySpringCGLIB$$b3ba55a5.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)at com.haiyisoft.eCodeBank.eCodeBankService.cap.service.impl.CapUpBatchServiceImpl$$EnhancerBySpringCGLIB$$94376a46.insert(<generated>)at com.haiyisoft.eCodeBank.eCodeBankService.cap.controller.CapUpBatchController.save(CapUpBatchController.java:161)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.refle

大致意思不能对 com.alibaba.excel.cache.Ehcache初始化,原因是项目中的ehache是3.2.1版本,而easyexcel中是3.4版本,解决办法直接在pom文件中添加3.4版本的依赖,maven会重新自动导入3.4版本的jar包覆盖掉原来的版本

org.ehcache
ehcache
3.4.0


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部