You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Nandan Kidambi <nk...@gmail.com> on 2004/10/15 11:45:27 UTC

Pls HELP!! getting java.io.IOException: Invalid header signature;

Scenario:
Iam trying to read and write an excel sheet from a server to a client. I have 
to read the excel from a DBserver & workflow server (which is not the same from 
tomcat server and has a firewall between them.) So making a http conn from 
servlet engine server. 
I know that in the url Iam getting a valid excel file ( coz from the server 
where it was written to by another process I can open it).

Reading a stream from Http (via a httpurlconnection.getinputstream()). 
This iam writing to the response : like below..

response.setContentType("application/vnd.ms-excel");
InputStream in= httpurlconnection.getInputStream();
POIFSFileSystem fs= new POIFSFileSystem(in);
HSSFWorkbook wb = new HSSFWorkbook();
OutputStream out = response.getOutputStream();
wb.write(out);
out.close();

When I execute, Iam getting the below error.. Could someone please help ?? This 
is stopping our dev for the customer. What am I doing wrong or should do 
differently?

java.io.IOException: Invalid header signature; read 8387989908914269500,
expected -2226271756974174256
at org.apache.poi.poifs.storage.HeaderBlockReader(HeaderBlockReader.java :124)
at org.apache.poi.poifs.filesystem.POIFSFileSystem(POIFSFileSystem.java:120)




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Pls HELP!! getting java.io.IOException: Invalid header signature;

Posted by Danny Mui <da...@muibros.com>.
what version of hssf are you using?

Nandan Kidambi wrote:
> Scenario:
> Iam trying to read and write an excel sheet from a server to a client. I have 
> to read the excel from a DBserver & workflow server (which is not the same from 
> tomcat server and has a firewall between them.) So making a http conn from 
> servlet engine server. 
> I know that in the url Iam getting a valid excel file ( coz from the server 
> where it was written to by another process I can open it).
> 
> Reading a stream from Http (via a httpurlconnection.getinputstream()). 
> This iam writing to the response : like below..
> 
> response.setContentType("application/vnd.ms-excel");
> InputStream in= httpurlconnection.getInputStream();
> POIFSFileSystem fs= new POIFSFileSystem(in);
> HSSFWorkbook wb = new HSSFWorkbook();
> OutputStream out = response.getOutputStream();
> wb.write(out);
> out.close();
> 
> When I execute, Iam getting the below error.. Could someone please help ?? This 
> is stopping our dev for the customer. What am I doing wrong or should do 
> differently?
> 
> java.io.IOException: Invalid header signature; read 8387989908914269500,
> expected -2226271756974174256
> at org.apache.poi.poifs.storage.HeaderBlockReader(HeaderBlockReader.java :124)
> at org.apache.poi.poifs.filesystem.POIFSFileSystem(POIFSFileSystem.java:120)
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org