Bug 44739 - Unable to construct record instance. java.lang.IllegalArgumentException: invalid cell range (9, -1, 1, 1
Summary: Unable to construct record instance. java.lang.IllegalArgumentException: inva...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: All All
: P1 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-02 02:12 UTC by Lal M.R
Modified: 2008-04-03 13:55 UTC (History)
0 users



Attachments
Invalid Range Excel File (33.00 KB, application/vnd.ms-excel)
2008-04-02 22:02 UTC, Lal M.R
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lal M.R 2008-04-02 02:12:49 UTC
This file doest open in release 'poi-3.0.3-alpha1-20080401.jar' and latest..

Following is the error thrown.


org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
	at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:206)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:124)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:204)
	at TestUserHome.main(TestUserHome.java:37)
Caused by: java.lang.reflect.InvocationTargetException
	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.createRecord(RecordFactory.java:194)
	... 3 more
Caused by: java.lang.IllegalArgumentException: invalid cell range (9, -1, 1, 1)
	at org.apache.poi.hssf.record.cf.CellRange.<init>(CellRange.java:56)
	at org.apache.poi.hssf.record.CFHeaderRecord.fillFields(CFHeaderRecord.java:66)
	at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
	at org.apache.poi.hssf.record.CFHeaderRecord.<init>(CFHeaderRecord.java:54)
	... 8 more
Comment 1 Josh Micich 2008-04-02 08:22:23 UTC
Please upload an example spreadsheet that shows this bug
Comment 2 Lal M.R 2008-04-02 22:02:51 UTC
Created attachment 21773 [details]
Invalid Range Excel File

Invalid Range Excel File
Comment 3 Lal M.R 2008-04-02 22:04:11 UTC
I have attached the excel file
Comment 4 Josh Micich 2008-04-03 13:55:05 UTC
Fixed in svn r644473.

CellRange used to assume that ranges like "C:C" were possible, but C10:C65536 were not.  Actually, firstRow and lastRow can have any value between 0 and 65535 so ranges like C40000:C50000 should also be supported.

Both these problems were fixed.

The supplied test XLS file seems to read OK in Excel after being re-serialised by POI.   (This is not to be taken for granted. See ongoing work for bug 30311)