[alibaba/easyexcel]easyexcel3.0.5无法读取到excel内容,excel手动Ctrl s保存一下后就可以读取,附相关代码以及报错

2024-05-16 739 views
8
   EasyExcel.read(file, new DemoExcelSheetListener).sheet(0).doRead();

异常提示

java.lang.IndexOutOfBoundsException: Index: 164, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at com.alibaba.excel.cache.MapCache.get(MapCache.java:29) at com.alibaba.excel.analysis.v07.handlers.CellTagHandler.endElement(CellTagHandler.java:68) at com.alibaba.excel.analysis.v07.handlers.sax.XlsxRowHandler.endElement(XlsxRowHandler.java:91) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at com.alibaba.excel.analysis.v07.XlsxSaxAnalyser.parseXmlSource(XlsxSaxAnalyser.java:197) at com.alibaba.excel.analysis.v07.XlsxSaxAnalyser.execute(XlsxSaxAnalyser.java:218) at com.alibaba.excel.analysis.ExcelAnalyserImpl.analysis(ExcelAnalyserImpl.java:123) at com.alibaba.excel.ExcelReader.read(ExcelReader.java:67) at com.alibaba.excel.ExcelReader.read(ExcelReader.java:57) at com.alibaba.excel.read.builder.ExcelReaderSheetBuilder.doRead(ExcelReaderSheetBuilder.java:65) at com.cicc.util.StringUtils.main(StringUtils.java:280)

建议描述

回答

3

这个需要提供excel

3

我也遇见你说的情况了, 按你说的 ctrl s就好了...

6

这个问题是否已经解决?未解决请重新打开问题