发布时间:2026-07-21阅读(0)
在使用Spring Boot2 集成EasyExcel的过程中,会出现如下错误:,接下来我们就来聊聊关于springboot表格怎么显示?以下内容大家不妨参考一二希望能帮到您!

springboot表格怎么显示
在使用Spring Boot2 集成EasyExcel的过程中,会出现如下错误:
java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.beans.BeanMap$Generator
或者
com.alibaba.excel.Exception.ExcelGenerateException: java.lang.ExceptionInInitializerError
这是由于EasyExcel3版本中,引用的cglib中asm与Spring Boot的中asm的冲突引起的,只需要把EasyExcel的cglib中的asm剔除即可。
对EasyExcel3引用如下:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.3.0</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
按照上面的引用,重新运行程序即可。
Copyright © 2024 有趣生活 All Rights Reserve吉ICP备19000289号-5 TXT地图HTML地图XML地图