poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Projer <ymasdm...@yahoo.es>
Subject Problem with 'Unable to construct record instance'
Date Tue, 04 Aug 2009 15:20:18 GMT

Hi,

I'm trying to read an Excel document ( Please, look at the sample attachment
). I am using poi-3.5-beta6.jar. When I create a HSSFWorkbookobject, I get
the following error:


[2009-08-04 15:18:24] [http-8080-Processor24]
[org.apli.utils.excel.ExcelUtils.readExcel(158)] ERROR - Unable to construct
record instance
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance
	at
org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:71)
	at
org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:269)
	at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:408)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:277)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:202)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:184)
	at org.apli.utils.excel.ExcelUtils.readExcel(ExcelUtils.java:95)
	at org.apli.business.LoadExcel.Data(LoadExcel.java:25)
	at org.apli.utils.Pruebas.PruebaImportacion(Importacion:75)
	at org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.ja.cgob.rael.migra.web.filter.PersistenceFilter.doFilter(PersistenceFilter.java:75)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to
find a ContinueRecord in order to read remaining 33 of 62 chars
	at
org.apache.poi.hssf.record.RecordInputStream.readStringCommon(RecordInputStream.java:318)
	at
org.apache.poi.hssf.record.RecordInputStream.readUnicodeLEString(RecordInputStream.java:273)
	at org.apache.poi.hssf.record.FormatRecord.<init>(FormatRecord.java:51)
	at sun.reflect.GeneratedConstructorAccessor31.newInstance(Unknown Source)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at
org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:63)
	... 35 more


This is the code I use:

       InputStream is = new FileInputStream( nameFile );
       POIFSFileSystem fs = new POIFSFileSystem( is );
       HSSFWorkbook wb = new HSSFWorkbook( fs ); 


Could you help me or give me any clue on this problem ?

Thanks in advance,

Imasdmasi.

http://www.nabble.com/file/p24810671/Example.xls Example.xls 
-- 
View this message in context: http://www.nabble.com/Problem-with-%27Unable-to-construct-record-instance%27-tp24810671p24810671.html
Sent from the POI - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message