When I recently studied using sax to read large Excel files, the following error occurred:
Java.lang.IllegalStateException:Zip File is closed
At Org.apache.poi.openxml4j.util.ZipFileZipEntrySource.getEntries (zipfilezipentrysource.java:45)
At Org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl (zippackage.java:161)
At Org.apache.poi.openxml4j.opc.OPCPackage.getParts (opcpackage.java:662)
At Org.apache.poi.openxml4j.opc.OPCPackage.open (opcpackage.java:223)
At Org.apache.poi.openxml4j.opc.OPCPackage.open (opcpackage.java:186)
At Com.speed.excel.Excel2007Reader.process (excel2007reader.java:80)
In the literal sense, the zip file is closed, but it is not, because the file directory is e:\\tasktemplate when you read the Excel code. xls (the correct excel2003 format) is written in E:\\tasktemplate. xlsx, causing the result, and then curious to try again on the original existing
e:\\ the new Microsoft Excel worksheet. xlsx file is changed to e:\\ new Microsoft Excel worksheet. xls, this time the error of the report became
Java.io.filenotfoundexception:e:\ new Microsoft Excel worksheet. xls (the system cannot find the file specified.) ),
Therefore, in the processing of two kinds of Excel reading must pay attention to, because two kinds of reading Excel inconsistent result in the file name is wrong, the reported exception will be different, do not words too literally.
Java.lang.IllegalStateException:Zip File is closed