java.lang.IllegalStateException: Zip File is closed
最近在研究利用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的更多相关文章
- 解决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 ...
- Android开发之Okhttp:java.lang.IllegalStateException: closed
在使用Okhttp的时候 运行到response.body().string()一步时抛异常,java.lang.IllegalStateException: closed 查阅各种资料大致意思是Th ...
- 云笔记项目- 上传文件报错"java.lang.IllegalStateException: File has been moved - cannot be read again"
在做文件上传时,当写入上传的文件到文件时,会报错“java.lang.IllegalStateException: File has been moved - cannot be read again ...
- 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 ...
- 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 ...
- 解决java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext问题
使用ClassPathXmlApplicationContext加载项目时, ClassPathXmlApplicationContext context = new ClassPathXmlAppl ...
- Android开发中使用数据库时出现java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.
最近在开发一个 App 的时候用到了数据库,可是在使用数据库的时候就出现了一些问题,在我查询表中的一些信息时出现了一下问题: Caused by: java.lang.IllegalStateExce ...
- 项目启动异常,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 ...
- 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 双击启动失败, ...
随机推荐
- 伪类:after的使用以及结合attr来添加属性的技巧
本案例以实现侧边栏的效果为例来说明 直接上代码看效果: css <style type="text/css"> *{;;list-style: none;} ul{;t ...
- C#学习笔记(十四):多态、虚方法和抽象类
虚方法/非虚方法 < 实例方法 = 非静态方法 = 非类方法(非实例方法 = 静态方法 = 类方法) 函数签名(参数列表,或参数列表 + 返回类型) using System; using Sy ...
- 解决Ubuntu14.04 下 E: Encountered a section with no Package: header 问题
参考: ubuntu-E:Encountered a section with no Package: header的解决办法 解决Ubuntu14.04 下 E: Encountered a sec ...
- Python 获取文件的创建时间,修改时间和访问时间
# 用到的知识# os.path.getatime(file) 输出文件访问时间# os.path.getctime(file) 输出文件的创建时间# os.path.getmtime(file) 输 ...
- yaml 文件保存
with open(mpath, "w") as f: yaml.safe_dump(yaml_dict,f,encoding='utf-8', allow_unicode=Tru ...
- ng的概念层次(官方文档摘录)
官方文档是这么说的: You write Angular applications by: composing HTML templates with Angularized markup, writ ...
- Eclipse 设置代码风格
自动调整代码风格 快捷键Ctrl + Shift + F 或者 右键 source -> format 设置代码风格 window -> preference -> java -&g ...
- Apache Spark探秘:利用Intellij IDEA构建开发环境
1)准备工作 1) 安装JDK 6或者JDK 7 或者JDK8 mac 的 参看http://docs.oracle.com/javase/8/docs/technotes/guide ...
- XML删除节点
XmlDocument doc = new XmlDocument(); doc.Load("Order.xml"); XmlNode xn = doc.SelectSingleN ...
- PKU Judge Online 安装指南
一 安装 JDK 1.5 1 下载 到 Sun 官方网站( http://java.sun.com/j2se/1.5.0 /download.jsp )下载 j2sdk ,注意下载为 JDK 5.0 ...