I am using an Excel 2000 file. POI works perfectly on a Linux env. When I try to use the same thing on a solaris box, it comes back with "An Invalid Header Signature" Error.
Does it happen in 1.5.x? (1.0.2 was a looooong time ago)
Happens with 1.5.1 also
attach us a file that exhibits this problem. The minimum amount of code necessary to reproduce it. Ensure that your file loads in excel (that no one has CR/LF converted it by accident while ftping in ASC mode). Also try with a nightly build to ensure that this isn't a "default encoding" problem (which was recently fixed but I can probably give you a workaround for 1.5.1). Also what version of Solaris? And I'm asuming this is Soalris Solaris and not x86 Solaris.
Invalid header signature; read 4547016314657521471, expected - 2226271756974174256 gets generated for J2SE v 1.4.1 Worked OK with J2SE v 1.2.2
Has anyone else seen this? This looks like an Endian problem but that makes no sense. Can we see some files/code?
Hi, I got this error while reading a file into POIFSFileSystem by using POI. The platform is Win2000, jdk1.3.1 MS Excel could open this file, but failed with POI 1.5.1 java.io.IOException: Invalid header signature; read 3546922463590896708, expecte d -2226271756974174256 at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockRead er.java:124) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSyste m.java:120) at excel2xml.readExcelFilesFromDir(excel2xml.java:54) at excel2xml.main(excel2xml.java:210)
Nothing has happened on this bug since no files were attached. Nothing is likely to happen unless example files are attached. It is not possible to debug a file open problem without seeing the file!
I encountered this same error. I was using an excel document as a template for generating an excel report via the web. The webserver threw the same exception so I copied the template from my build tree to /tmp and stripped down my jsp page to a bare essentials java class and it worked. So, I then executed a diff on my xls file in my build directory and the one deployed by weblogic and they differed! I'm using ANT to handle my building and packaging. I mistakenly added filtering to a copy task that included my excel files. That was enough to corrupt my xls files. After splitting out the xls files from the filtered copy task all is well. Well, I just wanted to comment on my mistake to hopefully help others down the road. Thanks.
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. Perry Tew's anectode above explains another such scenario. This is all the more likely in this bug, as the description talks about code working in one env, and not another. Moreover, no file has been attached to this bug, making it impossible to debug. Hence marking invalid.
Created attachment 14465 [details] Excel file that reproduces this bug - fails when I use HSSFWorkbook This file opens when I use Microsoft Excel 2000 (9.0.2720) but fails when I use HSSFWorkbook. I have read issues regarding xl files being created using web responses etc. and this indeed is a file which was generated by a web application (and downloaded). However this file opens when I use Microsoft Excel 2000.
Created attachment 14466 [details] Java code to use with the Excel file I attached
Comment on attachment 14465 [details] Excel file that reproduces this bug - fails when I use HSSFWorkbook java version used - JDK1.4.2. OS - Linux poi file name - poi-bin-2.5.1-final-20040804.zip
I have added an xl file that opens in Microsoft Excel 2000 (9.0.2720) but throws exception - java.io.IOException: Invalid header signature; read 8026294563841076540, expected -2226271756974174256 at org.apache.poi.poifs.storage.HeaderBlockReader.<init> (HeaderBlockReader.java:88) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init> (POIFSFileSystem.java:83) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:210) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:191) at test.msxl.ReadXL.readWB(ReadXL.java:25) at test.msxl.ReadXL.main(ReadXL.java:48) Using JDK1.4.2 on Linux .
OK.. here is more information The file is really HTML and NOT XL . . so sorry about all the posts .