Bug 46693 - org.apache.poi.hssf.record.RecordFormatException when reading an xls file
Summary: org.apache.poi.hssf.record.RecordFormatException when reading an xls file
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows Server 2003
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
: 46892 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-11 04:18 UTC by Vinu Kumar
Modified: 2009-06-04 14:58 UTC (History)
2 users (show)



Attachments
XLS file used for testing (47.50 KB, application/vnd.ms-excel)
2009-02-11 04:18 UTC, Vinu Kumar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vinu Kumar 2009-02-11 04:18:22 UTC
Created attachment 23247 [details]
XLS file used for testing

With r742126, I am getting exception while reading an xls file.

Stack trace:

org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:226)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:352)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:276)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:201)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:317)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:59)

Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to find a ContinueRecord in order to read remaining 65535 of 65535 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.pivottable.ExtendedPivotTableViewFieldsRecord.<init>(ExtendedPivotTableViewFieldsRecord.java:57)
	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:494)
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:224)
	... 41 more
Comment 1 Josh Micich 2009-02-11 18:41:01 UTC
Thanks for the sample file. It showed up another 3 bugs as well.  Some were introduced due to edits made while applying patch for release 3.5-beta5 (bug 46301 , svn r721007 ). 

All four bugs were fixed and junits added in svn r743601 .
Comment 2 Josh Micich 2009-03-23 14:33:58 UTC
*** Bug 46892 has been marked as a duplicate of this bug. ***
Comment 3 Josh Micich 2009-06-04 14:58:06 UTC
*** Bug 47305 has been marked as a duplicate of this bug. ***