-
poi HSSF does not currently support encrypted workbooks0
在
HSSFWorkbook workbook = new HSSFWorkbook(new POIFSFileSystem(fis));
创建HSSFWorkbook对象的时候,打开个别excel报下面的错误:
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:186)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:328)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:271)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:196)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:178)
at com.ahtax2009.investigation.struts.action.CommonCompanyFinancialTargetAction.loadUploadTempFiele(CommonCompanyFinancialTargetAction.java:817)
at com.ahtax2009.investigation.struts.action.CommonCompanyFinancialTargetAction.loadDataFromExcel(CommonCompanyFinancialTargetAction.java:752)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filters.HeaderFilter.doFilter(HeaderFilter.java:49)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ahtax2009.sercurity.OpenSessionInViewFilterExtend.doFilterInternal(OpenSessionInViewFilterExtend.java:132)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.ahtax2009.sercurity.AuthanticationFilter.doFilter(AuthanticationFilter.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.poi.hssf.record.RecordFormatException: HSSF does not currently support encrypted workbooks
at org.apache.poi.hssf.record.FilePassRecord.<init>(FilePassRecord.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:184)
它说打不开这个加密的文档,我打开这类加密的文档一般都正常,有些文档用户填写数据后,传上来poi就打不开了,就报这样的错误了,怎么办?
目前我用的是poi-3.2版本的,我试过poi-3.5、3.6、3.7、3、8 四个版本都没解决这个问题,困扰了我很久,请求帮助!!!2012年10月15日 11:13
相关推荐
Apache POI HSSF和XSSF读写EXCEL总结
标题中的“POI HSSF”指的是Apache POI项目中的HSSF组件,这是一个Java库,用于读写Microsoft Excel(.xls)文件格式。Apache POI是一个流行的开源库,它允许开发者在Java应用程序中处理Microsoft Office文档,包括...
HSSF(Horizontally Stored Sheet Format)是Apache POI项目的一部分,专注于处理旧版的Excel文件格式,即BIFF8格式,通常用于.xls文件。以下是对使用Apache POI HSSF进行Excel读写操作的详细知识点: 1. **HSSF...
解决POI读取EXCEL时报org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException异常
`org.apache.poi.hssf.converter` 是Apache POI的一个子模块,它专注于处理老版本的Excel文件(.xls),也就是基于HSSF(Horizontally Stored Spreadsheet Format)的文件。 在这个标题为“org.apache.poi.hssf....
velocity开发插件org.apache.poi.hssf.usermodel.HSSFCellorg.apache.poi.hssf.usermodel.HSSFCell
import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFPalette; ...
其中,HSSF(Horizontally Split Formatted)是POI库的一个子项目,主要负责处理老版本的Excel文件,即.BIFF8格式的Excel 97-2007文件。在本文中,我们将深入探讨POI HSSF 3.2版本中的核心概念和操作API。 首先,`...
import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFPalette; ...
### Apache POI HSSF and XSSF 快速指南帮助文档 API poi-3.15 #### 一、Apache POI 概述 Apache POI 是一个用于读取和写入 Microsoft Office 格式文件(如 Word 和 Excel)的开源 Java 库。它支持多种格式,包括...
color org.apache.poi.hssf.util.HSSFColor$GREY_80_PERCENT@1aadbf7 color org.apache.poi.hssf.util.HSSFColor$INDIGO@4f4458 color org.apache.poi.hssf.util.HSSFColor$PLUM@100c56 color org.apache.poi....
在"poi-3.8-POI-HSSF和POI-XSSF和SXSSF.rar"这个压缩包中,主要涵盖了POI项目对Excel文件处理的三个关键组件:HSSF、XSSF和SXSSF。 1. HSSF (Horrible Spreadsheet Format):这是POI项目早期开发的一个API,用于...
It does not support the new Excel 2007 .xlsx OOXML file format, which is not OLE2 based. HSSF provides a way to read spreadsheets create, modify, read and write XLS spreadsheets It provides: low ...
org.apache.poi JAR包,解决import org.apache.poi.hssf.usermodel.HSSFWorkbook; 支持office全系excel文件解析。 import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; ...
### 使用Apache POI HSSF控制Excel的研究 #### 一、简介 Apache POI是一个流行的Java库,用于处理Microsoft Office格式的文件,包括Excel (`.xls`) 和Word (`.doc`)等。其中,HSSF(Hadoop Sheet Storage Format)...
解析excel数据入库的三个jar包,org.apache.poi.hssf.usermodel.HSSFCell; org.apache.poi.hssf.usermodel.HSSFRow; org.apache.poi.hssf.usermodel.HSSFSheet; org.apache.poi.hssf.usermodel.HSSFWorkbook;
在本文中,我们将深入探讨如何使用POI库中的HSSF和XSSF组件来读取和写入Excel文件,这两种组件分别用于处理.xls(97-2003版Excel格式)和.xlsx(2007及更高版本的Office Open XML格式)。 首先,让我们了解HSSF...
HSSF Excel XLS poi HSLF PowerPoint PPT poi-scratchpad HWPF Word DOC poi-scratchpad HDGF Visio VSD poi-scratchpad HPBF Publisher PUB poi-scratchpad HSMF Outlook MSG poi-scratchpad XSSF Excel XLSX...
Apache POI项目提供了HSSF和XSSF两个模块,分别用于操作旧版的Excel文件(.xls)和新版的Excel文件(.xlsx)。HSSF代表Horrible Spreadsheet Format,是针对Excel 97-2003文件格式的实现;而XSSF代表XML Spreadsheet...