EasyExcel读数据报错 org.apache.poi.openxml4j.opc.OPCPackage.open(Ljava/io/File;)Lorg/apache/poi/openxml4j

前提:

(1)直接导入依赖并使用,可正常读内容

EasyExcel读数据报错 org.apache.poi.openxml4j.opc.OPCPackage.open(Ljava/io/File;)Lorg/apache/poi/openxml4j_第1张图片

 

(2)引入公司父工程,导入的easyexcel版本 变为如下,取数据报如下错:

EasyExcel读数据报错 org.apache.poi.openxml4j.opc.OPCPackage.open(Ljava/io/File;)Lorg/apache/poi/openxml4j_第2张图片


com.alibaba.excel.exception.ExcelAnalysisException: java.lang.NoSuchMethodError: org.apache.poi.openxml4j.opc.OPCPackage.open(Ljava/io/File;)Lorg/apache/poi/openxml4j/opc/OPCPackage;

    at com.alibaba.excel.analysis.ExcelAnalyserImpl.(ExcelAnalyserImpl.java:57)
    at com.alibaba.excel.ExcelReader.(ExcelReader.java:145)
    at com.alibaba.excel.read.builder.ExcelReaderBuilder.build(ExcelReaderBuilder.java:193)
    at com.alibaba.excel.read.builder.ExcelReaderBuilder.sheet(ExcelReaderBuilder.java:229)
    at com.alibaba.excel.read.builder.ExcelReaderBuilder.sheet(ExcelReaderBuilder.java:221)
    at com.bank.ReadWriterVerifyParam.verifyParamt(ReadWriterVerifyParam.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.NoSuchMethodError: org.apache.poi.openxml4j.opc.OPCPackage.open(Ljava/io/File;)Lorg/apache/poi/openxml4j/opc/OPCPackage;
    at com.alibaba.excel.analysis.v07.XlsxSaxAnalyser.readOpcPackage(XlsxSaxAnalyser.java:137)
    at com.alibaba.excel.analysis.v07.XlsxSaxAnalyser.(XlsxSaxAnalyser.java:63)
    at com.alibaba.excel.analysis.ExcelAnalyserImpl.choiceExcelExecutor(ExcelAnalyserImpl.java:99)
    at com.alibaba.excel.analysis.ExcelAnalyserImpl.(ExcelAnalyserImpl.java:51)
    ... 27 more
 

 

怎么解决呢?

(1)加入父依赖后,怎么将导入的依赖版本变为正常的版本号呢?

 

持续更新内容。。。。

你可能感兴趣的:(EasyExcel读数据报错 org.apache.poi.openxml4j.opc.OPCPackage.open(Ljava/io/File;)Lorg/apache/poi/openxml4j)