MyEclipse报如下错误:
java.io.FileNotFoundException: no such entry: "EncryptionInfo", had: [DocumentSummaryInformation, ETExtData, SummaryInformation, Workbook]
at org.apache.poi.poifs.filesystem.DirectoryNode.getEntry(DirectoryNode.java:370)
at org.apache.poi.poifs.filesystem.DirectoryNode.createDocumentInputStream(DirectoryNode.java:177)
at org.apache.poi.poifs.crypt.EncryptionInfo.<init>(EncryptionInfo.java:51)
at org.apache.poi.poifs.crypt.EncryptionInfo.<init>(EncryptionInfo.java:43)
at com.xyw.util.ReadPwdExcel.readStudentXlsx(ReadPwdExcel.java:69)
at com.xyw.servlet.FileUploadServlet.doPost(FileUploadServlet.java:128)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:745)
由于本人刚开始学,很多都不懂,请教各位大神,项目要求在网页上上传压缩文件,在后台保存到另外一个固定的文件夹中,再解压出来,里面是两个Excel文件,接下来就是解析Excel了,我用的是poi解析,最后要将解析出来的数据传到网页上。
我现在的问题是无法获取从前台传过来的Excel密码。能给我一些建议吗?
很尴尬,这个问题是因为我的粗心大意造成的。原来我在新建Excel文件时把格式(xls)改为格式(xlsx)。这是因为我采用的是XSSF,读取的是xlsx格式的Excel。后来还是我同学提醒了我,故做事情一定要细心,出现问题时也要仔仔细细的检查,与项目有关的任何事情都要细心检查一遍。