Bug 21049

Summary: Cannot Instantiate HSSFWorkBook on large excel document
Product: POI Reporter: Godfrey Nang'oma <gnangoma>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Sun   
OS: Solaris   

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)