I am getting this exception on one specific document from a customer. The origin of this document is unclear. We're running POI 3.0.1 Final. Has this issue been resolved since? I know other folks have reported something similar before, e.g. https://issues.apache.org/bugzilla/show_bug.cgi?id=32076 Please advise. Thanks.
Created attachment 22182 [details] the doc This is the document that I'm seeing the behavior on.
Here is the stack trace: java.io.IOException: block[ 44 ] already removed at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:97) at org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:190) at org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:129) at org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties(POIFSFileSystem.java:412) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:103)
I'm pretty sure this was fixed a while back. Please try with 3.1-BETA2, or 3.1 final when that comes out (hopefully next week)
Just as a comment. If have seen this error once when I was trying to load an xls-file that (wrongly) has been placed in CVS with ASCII substitution. As soon as the file was converted to binary the error disappeared.
Folks, I just verified and I am still seeing this exception with 3.2 FINAL. We really would like to see this fixed since we have a customer that keeps asking about it :) And I'd love to contribute to the fix but unfortunately the "block[ 44 ] already removed" error is not informative enough for me to do anything about it. Anyone? Thanks!
I was pretty sure we had fixed this in svn months and months ago :( Can you confirm that the excel file attached to the bug triggers it?
Nick, Yes, this indeed is the case; I'm seeing the behavior on the attached file, using 3.2 FINAL. Here is the stack trace: java.io.IOException: block[ 44 ] already removed at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:97) at org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:190) at org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:130) at org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties(POIFSFileSystem.java:530) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:176) - Dmitry
Ah, this is a subtly different error message to the one in bug #44898 Some digging deep into poifs is probably needed
Your file seems really odd - the block containing the header information is then listed at the end of the normal blocks list. So, poifs pulls out the header block to process, then sets off along the data block list, hits a reference to the header block that's already been handled, and gets in a huff I've just committed a workaround to svn, where if the block is already gone and it's the header block, then consider the data blocks section done. Hopefully that'll fix it for you, but there does seem to be something very odd about the file. Do you happen to know how it was created?
Nick, No idea really how this file was created. It came from a customer and I believe they had been googling for test files. Could you point me at the the files that contain your fix? Is this off 3.2 FINAL? Thanks for the quick turnaround!
commits@poi.apache.org IYF here: http://mail-archives.apache.org/mod_mbox/poi-commits/ http://mail-archives.apache.org/mod_mbox/poi-commits/200811.mbox/%3c20081112182543.8D52C23888F1@eris.apache.org%3e