Bug 35385

Summary: InvalidHeaderSignature
Product: POI Reporter: Neelima Madhavaram <nilus_m>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P1    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Neelima Madhavaram 2005-06-16 16:19:20 UTC
Hi POI users,

 I am trying to read an excel file from a java program. 
For first 10 times it worked fine but later it started giving
InvalidHeaderSignature Error. 

java.io.IOException: Invalid header signature; read 7521418675403179042, 
expected -2226271756974174256
15:32:25,274 INFO [STDOUT] at 
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.j 
ava:88)
15:32:25,274 INFO [STDOUT] at 
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.ja 
va:83)


By searching in poi archives, I got to know that many users got the same 
problem but no where I could find the solution. 
I understand that it is not a properly saved excel file.

But this is the file we are going to receive from customers.
Every time we can not open the file and copy the contents.
Is there any way we can solve this problem?

One more problem I am facing is,  when I am reading a cell, the data inside 
the cell is 3732135467(phone no) but excel displays it as 3.7+e9  when I am 
trying to read it, POI getCell() 
Displays it as 3.732135467+e9 . Is there a way to display the correct data?

Thanks
nmadhava
Comment 1 Avik Sengupta 2005-07-05 14:36:07 UTC
"Invalid Header Signature" means the file stream is incorrect.. either the file
is corrupt, or is not a xl file. So poi cant help here. Please check upstream.