蔷薇花园

 找回密码
 发芽

QQ登录

只需一步,快速开始

搜索
热搜: myeclipse 静临
查看: 7776|回复: 0

POI读EXCEL的加载异常

[复制链接]
发表于 2012-4-16 11:29:13 | 显示全部楼层 |阅读模式
异常一:
Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:237)
at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)


问题:导入数据报如此异常
解决方案:数据->筛选->自动筛选勾掉 ,异常消失。



异常二:
java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedConstructorAccessor80.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)
        at com.phluency.jacsite.util.ImportContactsListExcel.impContact(ImportContactsListExcel.java:32)
        at org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.admin.jac.admin.service.import6_005fbackup_jsp._jspService(import6_005fbackup_jsp.java:134)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        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 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
        at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:509)
        at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:1052)
        at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1491)
        at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:153)
        at org.opencms.main.OpenCmsServlet.doPost(OpenCmsServlet.java:166)
        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 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.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62)
        at org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:57)
        at org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99)
        at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:61)
        ... 40 more
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:237)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)
        at com.phluency.jacsite.util.ImportContactsListExcel.impContact(ImportContactsListExcel.java:32)
        at org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.admin.jac.admin.service.import6_005fbackup_jsp._jspService(import6_005fbackup_jsp.java:134)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        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 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
        at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:509)
        at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:1052)
        at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1491)
        at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:153)
        at org.opencms.main.OpenCmsServlet.doPost(OpenCmsServlet.java:166)
        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 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.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:636)

【现象】
对Excel的窗口作冻结后,使用poi导入数据时,出现此错误!
【分析】
POI对Micorosoft的Excel的高级附加功能不支持。在使用POI解析Excel时,建议不要对Excel进行高级编辑,如冻结窗口、有效性、过滤等
【解决】
取消Excel中的冻结限制,重新导入Excel。或者把数据复制到新建的Excel中。
您需要登录后才可以回帖 登录 | 发芽

本版积分规则

小黑屋|手机版|Archiver|Rosebush Garden ( 冀ICP备11004408号 )

GMT+8, 2020-10-26 00:54 , Processed in 0.015911 second(s), 12 queries , Gzip On, Eaccelerator On.

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表