Bug 21049 - Cannot Instantiate HSSFWorkBook on large excel document
Summary: Cannot Instantiate HSSFWorkBook on large excel document
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: Sun Solaris
: P3 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-24 14:37 UTC by Godfrey Nang'oma
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Godfrey Nang'oma 2003-06-24 14:37:15 UTC
The HSSFWorkBook construct throws exception when trying to instantiate an excel 
workbook from a large excel document. Specifically, the document has more than 
14,000 rows. 
When reducing the number of rows to ~7,000 no exception is thrown. Must be 
something to do with the number of rows.

Below is the exception:
java.lang.reflect.InvocationTargetException: 
java.lang.ArrayIndexOutOfBoundsException
        at org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:557)
        at org.apache.poi.util.LittleEndian.getInt(LittleEndian.java:177)
        at org.apache.poi.hssf.record.BOFRecord.fillFields(BOFRecord.java:170)
        at org.apache.poi.hssf.record.Record.fillFields(Record.java:143)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:105)
        at org.apache.poi.hssf.record.BOFRecord.<init>(BOFRecord.java:135)
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at org.apache.poi.hssf.record.RecordFactory.createRecord
(RecordFactory.java:257)
        at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:193)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:199)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:166)
        at ExcelReader.main(ExcelReader.java:73)
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:270)
        at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:193)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:199)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:166)
        at ExcelReader.main(ExcelReader.java:73)
Comment 1 Andy Oliver 2003-07-24 16:58:53 UTC
No, you're attempting to read like an Excel 95 file..  The bof record isnt' in
the correct format so its balking.  We don't support pre Excel 97 files (which
includes Star Office 5.0 or 5.1 [don't remember] written excel files BTW)