Bug 31310

Summary: Error reading header signature
Product: POI Reporter: Bob Demers <bobbyjdemers>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: excel file crashing on
Invalid Header Test Case

Description Bob Demers 2004-09-20 14:20:25 UTC
Here is the error from reading an excel document:

java.io.IOException: Invalid header signature; read 7888090397404325948, expecte
d -2226271756974174256
        at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockRead
er.java:88)
        at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSyste
m.java:83)

I have an excel document but not sure how to upload here...
Comment 1 Bob Demers 2004-09-20 14:22:46 UTC
Created attachment 12803 [details]
excel file crashing on
Comment 2 Glen Stampoultzis 2004-09-21 12:54:18 UTC
What did you use to create this file?  I've never seen this occur on a
non-corrupt file before.
Comment 3 Shawn Clowater 2005-10-03 19:33:04 UTC
Created attachment 16573 [details]
Invalid Header Test Case
Comment 4 Shawn Clowater 2005-10-03 19:33:44 UTC
I encountered the same type of problem while using the getBytes() of the 
HSSFWorkbook.

From the Javadoc, 

Method getBytes - get the bytes of just the HSSF portions of the XLS file.
Use this to construct a POI POIFSFileSystem yourself.

However, when I feed it to to POIFSFileSystem I get the invalid header error.  
I've attached a VERY simple test case that create a workbook with a single 
sheet and it fails when using getBytes() but it will create a readable excel 
spreadsheet and can be contstructed using the ByteArrayOutputStream.toByeArray
() method.
Comment 5 Andy Oliver 2005-10-03 19:53:26 UTC
The attached file is XML not an XLS BIFF file (not a bug).  The below question
is an incorrect API usage formed as a bug but its really a question (which
should be asked on the list).