Bug 35503 - HSSFWorkbook throws exception when opening specific Excel file
Summary: HSSFWorkbook throws exception when opening specific Excel file
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-25 05:12 UTC by John Roach
Modified: 2005-07-28 20:54 UTC (History)
0 users



Attachments
this is the excel file that causes the exception to be thrown (10.00 KB, application/octet-stream)
2005-06-25 05:14 UTC, John Roach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Roach 2005-06-25 05:12:29 UTC
This is similar (maybe identical) to #32822.  The following simple code throws
the same exception as 32822 when opening a specific Excel file.  Other Excel
files work fine.  The exception can be traced to BOFRecord.fillFields(byte []
data, short size, int offset), lines 133 and 134, where the history and rversion
fields are retrieved.  For this specific file, data.length = 8 which causes an
exception to be thrown.  However if the file is opened and saved without
modification, data.length is 16 when  it is opened and everything works fine.

        FileInputStream in = null;
        Statement statement = null;
        try{
            in = new FileInputStream("c:\\temp\\contact_info.xls");
            POIFSFileSystem fs = new POIFSFileSystem(in);
            HSSFWorkbook book = new HSSFWorkbook(fs);
        } catch (Exception except) {
            System.out.println(except);
        }
Comment 1 John Roach 2005-06-25 05:14:30 UTC
Created attachment 15532 [details]
this is the excel file that causes the exception to be thrown
Comment 2 Jason Height 2005-07-29 04:54:49 UTC
This is a BIFF 5/7 file and not a BIFF 8. The BOF record is 12 bytes. A BIFF 8
BOF record should be 20 bytes.

POI only supports BIFF 8.

Jason