最近在研究利用sax读取excel大文件时,出现了以下的错误:

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)

要是按字面意思来看,是Zip文件关闭了,其实不然,这是由于在读取excel代码时将文件目录E:\\taskTemplate.xls(正确的excel2003格式)写成了E:\\taskTemplate.xlsx,造成的结果,于是好奇的又试了一下将原本存在的

E:\\新建 Microsoft Excel 工作表.xlsx文件改成了E:\\新建 Microsoft Excel 工作表.xls,此时报的错变成了

java.io.FileNotFoundException: E:\新建 Microsoft Excel 工作表.xls (系统找不到指定的文件。),

所以,在处理两种excel读取时一定要注意,因为两种读取excel方式不一致造成文件名写错,报出的异常也会不同,切不可望文生义。

java.lang.IllegalStateException: Zip File is closed的更多相关文章

  1. 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext这个问题

    今天在运行别人的SSH项目时,遇到了这个问题 严重: Exception sending context initialized event to listener instance of class ...

  2. Android开发之Okhttp:java.lang.IllegalStateException: closed

    在使用Okhttp的时候 运行到response.body().string()一步时抛异常,java.lang.IllegalStateException: closed 查阅各种资料大致意思是Th ...

  3. 云笔记项目- 上传文件报错"java.lang.IllegalStateException: File has been moved - cannot be read again"

    在做文件上传时,当写入上传的文件到文件时,会报错“java.lang.IllegalStateException: File has been moved - cannot be read again ...

  4. Eclipse------使用Debug As时报错java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/XXX

    报错信息: java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file ...

  5. java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

    spring的项目中有时候会报错:java.lang.IllegalStateException: BeanFactory not initialized or already closed - ca ...

  6. 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext问题

    使用ClassPathXmlApplicationContext加载项目时, ClassPathXmlApplicationContext context = new ClassPathXmlAppl ...

  7. Android开发中使用数据库时出现java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.

    最近在开发一个 App 的时候用到了数据库,可是在使用数据库的时候就出现了一些问题,在我查询表中的一些信息时出现了一下问题: Caused by: java.lang.IllegalStateExce ...

  8. 项目启动异常,java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' befo ...

  9. myeclipse 无法启动 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).

    把myeclipse10 按照目录完整拷贝到了另外一台电脑, 另外的目录 原安装目录 D\:\soft\i\myeclipse10 新安装目录 E\:\soft\myeclipse10 双击启动失败, ...

随机推荐

  1. LaTex: Undefined citation warnings 解决方法

    参考 Undefined citations LaTex: Undefined citation warnings 解决方法 在使用TexMaker编译文献的时候,出现引用参考文献的问题: Packa ...

  2. 【Coursera】Fourth Week(1)

    1994: year of the web (1)网景(Netscape)成立. (2)www conference 在CERN 举办. (3)www conference 在芝加哥举办. (4)十月 ...

  3. Python非递归遍历多叉树

    class Queue: def __init__(self,max_size): self.max_size = int(max_size) self.queue = [] def put(self ...

  4. c++ 匹配A容器中最先出现的b容器中的元素,返回iterator,(find_first_of)

    #include <iostream> // std::cout #include <algorithm> // std::find_first_of #include < ...

  5. 解决MVC 时间序列化的方法

    1.全局处理 处理代码 publict static void SetSerializationJsonFormat(HttpConfiguration config) { // Web API co ...

  6. 滑动窗口解决Substring Search Problem

    2018-07-18 11:19:19 一.Minimum Window Substring 问题描述: 问题求解: public String minWindow(String s, String ...

  7. HTTP协议的请求与响应和CSS属性和定位

    HTTP协议的请求与响应和CSS属性和定位 一.HTTP协议 1.1 HTTP定义 HTTP(Hypertext Transport Protocol),超文本传输协议. 一种详细规定了浏览器和web ...

  8. 流氓 2345.com的新动态及解决方法

    安装了[电脑公司]的Win7_SP1之后, IE的主页被绑架. 症状是先转到 IE959.com,然后自动跳转到 www.2345.com 网上当然有很多例子了,可是都没有效果. 1. 更改IE设置没 ...

  9. 一个或多个音频服务未运行 win7 错误1079:此服务的账户不同于运行于同一进程上的其他服务账户

    一个或多个音频服务未运行 win7 错误1079:此服务的账户不同于运行于同一进程上的其他服务账户 启动任务管理器:右键计算机——管理——”服务和应用程序“选项——”服务“——找到“windows a ...

  10. Ivan and Burgers CodeForces - 1100F (线性基)

    大意: 给定n元素序列, m个询问$(l,r)$, 求$[l,r]$中选出任意数异或后的最大值 线性基沙茶题, 直接线段树暴力维护两个log还是能过的 #include <iostream> ...