Bug 16700 - Failure creating HSSFWorkbook : file uploaded from client : size more than 64.5 kb
Summary: Failure creating HSSFWorkbook : file uploaded from client : size more than 64...
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5
Hardware: Other All
: P3 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-02-03 13:11 UTC by vinit_kl
Modified: 2005-03-20 17:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description vinit_kl 2003-02-03 13:11:27 UTC
I submit the excel file from the client using IE Explorer 5.5 by the code given 

<form action="http://xxx/POIExample" method="post" enctype="multipart/form-
  <input size="70" type="file" name="spreadsheet" />
  <input type="submit" value="Upload File" />

In the servlet (running in Weblogic 6.1) I remove the extra data which comes in 
the HttpServletRequest and have the extract (only the content of the file) in 
the String "file": 

Then I use the following code to create the workbook

//the parse method returns the content of the excel file which was uploaded
1. String file = parse(req.getInputStream(),req.getContentLength

//this line creates the ByteArrayInputStream
2. ByteArrayInputStream is = new ByteArrayInputStream(file.getBytes());

//then try to create the workbook
3. HSSFWorkbook wb = new HSSFWorkbook(is);

If i upload the excel file from the client which is less than 64.5 kb, the 
HSSFWorkbook gets created successfully and I am able to read data.

But if the excel file size is greater than 64.5 kb it throws an error 

java.io.IOException: block[ 63 ] already removed
        at org.apache.poi.poifs.storage.BlockListImpl.remove
        at org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks
        at org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks
        at org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties
        at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
        at lehman.brokerlink.servlets.POIExample.doProcess(POIExample.java:88)
        at lehman.brokerlink.servlets.POIExample.doPost(POIExample.java:26)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet
        at weblogic.servlet.internal.WebAppServletContext.invokeServlet
        at weblogic.servlet.internal.ServletRequestImpl.execute
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Please note: If I try reading/creating the HSSFWorkbook from a java client by 
reading the same excel file (for which it was earlier throwing error), it does 
not throw any errors.
Comment 1 Andy Oliver 2003-02-03 14:35:57 UTC
post to the mailing list.  I doubt this is a POI bug.