springboot表格怎么显示(SpringBoot2使用EasyExcel)

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

springboot表格怎么显示(SpringBoot2使用EasyExcel)

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>

按照上面的引用,重新运行程序即可。

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页