java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/FileMagic报错

com.alibaba.excel.exception.ExcelAnalysisException: java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/FileMagic的easyexcel依赖问题

  • 使用easyexcel时报错java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/FileMagic
    • 解决方案

使用easyexcel时报错java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/FileMagic

初次使用easyexcel时报错
com.alibaba.excel.exception.ExcelAnalysisException: java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/FileMagic

解决方案

easyexcel需要额外导入相关的poi依赖
java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/FileMagic报错_第1张图片

如easyexcel 2.2.6 对应poi、poi-scratchpad、poi-ooxml 版本3.17

		<dependency>
            <groupId>com.alibabagroupId>
            <artifactId>easyexcelartifactId>
            <version>2.2.6version>
        dependency>
        <dependency>
            <groupId>org.apache.poigroupId>
            <artifactId>poiartifactId>
            <version>3.17version>
        dependency>
        <dependency>
            <groupId>org.apache.poigroupId>
            <artifactId>poi-scratchpadartifactId>
            <version>3.17version>
        dependency>
        <dependency>
            <groupId>org.apache.poigroupId>
            <artifactId>poi-ooxmlartifactId>
            <version>3.17version>
        dependency>


你可能感兴趣的:(java)