Bug 43493

Summary: RecordFormatException: On HSSFWorkbookFile Creation
Product: POI Reporter: Scott Rosenbaum <scottr>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED WONTFIX    
Severity: major    
Priority: P2    
Version: 3.0-FINAL   
Target Milestone: ---   
Hardware: Other   
OS: Windows Server 2003   
Attachments: Eclipse Project that shows problem behavior. Includes problem Excel File.

Description Scott Rosenbaum 2007-09-26 10:53:40 UTC
Using POI-3.0.1-FINAL

I have Excel files that are created by a third party utility (Actuate iServer).
 Most files open as HSSFWorkbook without problem.  Some files are reporting a
RecordFormatException.

If I open the problem files with Microsoft Office Excel 2003, the files open
correctly.  If I save the file (no changes) using same, then they open with
HSSFWorkbook just fine.  

I have attached a small Eclipse project with one Java program that demonstrates
the problem.  Just run the OpenFileError program and you should get the error.

thanks
Comment 1 Scott Rosenbaum 2007-09-26 10:55:18 UTC
Created attachment 20886 [details]
Eclipse Project that shows problem behavior.  Includes problem Excel File.

Eclipse Project that shows problem behavior.  Includes problem Excel File.
Comment 2 Nick Burch 2008-01-08 11:04:39 UTC
That file is really quite messed up :(

It's no good trying to catch the AIOOB exception and skip on, as by then the
whole input stream is messed up, and the next record to try to read some data
blows up with something else. No idea where the original problem is occuring,
only that when we try to read one particular sub-record we're out of data, and
probably should've stopped long long ago

I can't see us being able to handle these files, sorry, they're just too
cryptically broken. Probably your best bet is to script excel to open and
re-save them, as that has a workaround for whatever corruption these files have.