首页 > 编程语言 >使用EasyExcel报错 com.alibaba.excel.exception.ExcelGenerateException: java.lang.NoClassDefFoundError: or

使用EasyExcel报错 com.alibaba.excel.exception.ExcelGenerateException: java.lang.NoClassDefFoundError: or

时间:2022-08-23 16:44:08浏览次数:128  
标签:lang ExcelGenerateException NoClassDefFoundError 报错 poi apache org com

使用EasyExcel报错 com.alibaba.excel.exception.ExcelGenerateException: java.lang.NoClassDefFoundError: org/apache/poi/POIXMLTypeLoader 报错原因:缺少依赖或者依赖冲突,导致找不到类

使用postman测试结果如下:

 

 console 中报错如下:

 

 解决方法出处:https://www.jianshu.com/p/643fecc462fe 提示NoClassDefFoundError 检查依赖是否存在,或者依赖冲突问题

1、若依赖不存在

<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi</artifactId>
  <version>3.17</version>
</dependency>
<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi-ooxml</artifactId>
  <version>3.17</version>
</dependency>

2、若依赖冲突

<exclusions>
  <exclusion>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
  </exclusion>
  <exclusion>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    </exclusion>
  <exclusion>
    <artifactId>poi-ooxml-schemas</artifactId>
    <groupId>org.apache.poi</groupId>
  </exclusion>
</exclusions>

 

标签:lang,ExcelGenerateException,NoClassDefFoundError,报错,poi,apache,org,com
From: https://www.cnblogs.com/charler/p/16616826.html

相关文章