日期:2014-05-19  浏览次数:21177 次

Unable to construct record instance
用poi实现excel模板导入功能

同样的都是2003的excel模板,个别模板导入会出现下述错误,在网上搜了一下,大多都说是poi.jar版本的问题,我下载了最新的poi-3.8-20120326.jar包,提示信息还是报,只是最后的信息有点区别
请大家帮忙看看,有知道的,请告知,谢谢
Java code

- Unable to construct record instance
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
    at org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:65)
    at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:301)
    at org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:285)
    at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:251)
    at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:443)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:285)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:248)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:192)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:174)
    at com.git.loan.finance.bs.ExcelReader.open(ExcelReader.java:75)
    at com.git.loan.finance.bs.FinanceManageBS.setSubTbCsmCustomerFinanceBO(FinanceManageBS.java:2289)
    at com.git.loan.finance.bs.FinanceManageBS.createFinanceByUpload(FinanceManageBS.java:2228)
    at com.git.loan.finance.ucc.FinanceManageUCC.createFinanceByUpload(FinanceManageUCC.java:212)
    at com.git.loan.finance.ucc.FinanceManageUCC$$FastClassByCGLIB$$52217a98.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at cn.easyuda.framework.monitor.ServiceMonitor.invoke(ServiceMonitor.java:34)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
    at com.git.loan.finance.ucc.FinanceManageUCC$$EnhancerByCGLIB$$a324df8d.createFinanceByUpload(<generated>)
    at com.git.loan.finance.bb.FinanceManageBB.uploadFinanceNew(FinanceManageBB.java:775)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
    at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
    at javax.faces.component.UICommand.broadcast(UICommand.java:106)
    at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
    at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.Appli