Bug 31441 - Invalid header signature I/O exception
Summary: Invalid header signature I/O exception
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 2.5-FINAL
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-27 20:33 UTC by Anna Kazak
Modified: 2005-10-12 13:21 UTC (History)
0 users



Attachments
Sample Excel File (53.53 KB, application/vnd.ms-excel)
2005-09-15 23:24 UTC, AA
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Kazak 2004-09-27 20:33:57 UTC
Invalid header signature; read 7311066695147732796, expected -
2226271756974174256 exception is thrown when attempting to open excel 
spreadsheet.
Comment 1 Mikael Sitruk 2004-09-27 21:27:38 UTC
I had the same problem today \, but it seems that it was related to a problem 
in the excel file itself, it contained an XML stream into it. I've not 
finished yet to check the real problem. 

Was the spreadsheet that you try to read, in a database? Did you try to open 
it in excel?
Comment 2 Avik Sengupta 2004-11-18 15:03:22 UTC
Almost every case of "Invalid Header Signatures" that we've seen on the POI
lists has been due to operator error, feeding the wrong or corrupted file to
POI. Examples have included trying to read CSV files, or files getting corrupted
in webserver response. See bug 14493 for another example. Michael Sitruk
provides another scenario above. Moreover, no file has been
attached to this bug, making it impossible to debug. Hence marking invalid. 
Comment 3 Vijaykumar 2005-01-04 10:29:59 UTC
I also faced same problame when i m trying to read spreadsheet created using 
Open Office. I saved same file as "MicroSoft Excel97/200/xp" & read spreadsheet 
i haven't get any problem it worked


(In reply to comment #2)
> Almost every case of "Invalid Header Signatures" that we've seen on the POI
> lists has been due to operator error, feeding the wrong or corrupted file to
> POI. Examples have included trying to read CSV files, or files getting 
corrupted
> in webserver response. See bug 14493 for another example. Michael Sitruk
> provides another scenario above. Moreover, no file has been
> attached to this bug, making it impossible to debug. Hence marking invalid. 

Comment 4 AA 2005-09-15 23:24:24 UTC
Created attachment 16418 [details]
Sample Excel File
Comment 5 AA 2005-09-15 23:26:48 UTC
I don't know how the attached file (Sample Excel File) was created. I can open
it without a problem in Excel 2003.  POI gives following errors.

H:\>set classpath
classpath=h:\jtools\poi-2.5.1\poi-2.5.1-final-20040804.jar;h:\jtools\poi-2.5.1\p
oi-contrib-2.5.1-final-20040804.jar;h:\jtools\poi-2.5.1\poi-scratchpad-2.5.1-fin
al-20040804.jar

H:\>java org.apache.poi.hssf.dev.BiffViewer irrept50y.xls
java.io.IOException: Invalid header signature; read 4503599627764745, expected -
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)
        at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer.java:68)
        at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:649)

H:\>java org.apache.poi.contrib.poibrowser.POIBrowser irrept50y.xls
irrept50y.xls: java.io.IOException: Invalid header signature; read 4503599627764
745, expected -2226271756974174256
No POI filesystem(s) to display.

H:\>java -version
java version "1.4.2_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05)
Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)
Comment 6 AA 2005-09-15 23:33:20 UTC
Just realized the excel file was created using Excel 4.0 (when I go to excel and
use Save As option).  Any ideas how I can extend POI to open/parse this file?
Comment 7 Mansoor Javed 2005-09-21 18:09:24 UTC
I just encountered this issue today, and after reading the previous 
contributions, I think they're right.  I tried using HSSF on two spreadsheets: 
one I created in Excel, the other I downloaded from the web.  The one I 
downloaded was getting this error.  After reading this issue, I opened them in 
Notepad.

The spreadsheet I created began with this (binary?) stuff:
     ÐÏࡱá

The spreadsheet from the web started with this:
     <HTML><HEAD><TITLE>A Spreadsheet</TITLE></HEAD>

So, even though it had a .xls extension, it was just an HTML table.  Inside 
Excel, I copied the spreadsheet into a new sheet, and it worked.

Now, this is my first contribution to the bug database, so I don't want to 
change the status, but this seems like expected behavior to me.
Comment 8 Andy Oliver 2005-09-21 19:29:09 UTC
The XLS 4.0 format is vastly different.  You'd have to practically start from
scratch.  It would be "doable" to go to Excel 95 (lots of minor things), but
completely unfeasible for 4.0.  Economics predicts that there will be no
successful attempt to do so at this stage.  (You're unlikely to spend enough
time to do the work and no one will likely contribute.
Comment 9 AA 2005-10-12 21:21:49 UTC
Comment on attachment 16418 [details]
Sample Excel File

please remove the attached file.