You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Sebastien ARBOGAST <se...@gmail.com> on 2009/05/27 16:25:07 UTC

Does your POIFS have circular or duplicate block references?

I'm trying to read an existing Excel file with the following code:
File billFile = new File(bill.getFilePathOnServer());
        InputStream inp;
        Workbook workbook;
        try {
            inp = new FileInputStream(billFile);
            workbook = WorkbookFactory.create(inp);
        } catch (Exception e) {
            throw new
CannotReadBillFileException(billFile.getAbsolutePath());
        }

The file exists, it can be read, but WorbookFactory throws the following
exception:

java.io.IOException: block[ 44016 ] already removed - does your POIFS have
circular or duplicate block references?
 at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:97)
at
org.apache.poi.poifs.storage.BlockAllocationTableReader.fetchBlocks(BlockAllocationTableReader.java:196)
 at
org.apache.poi.poifs.storage.BlockListImpl.fetchBlocks(BlockListImpl.java:132)
at
org.apache.poi.poifs.filesystem.POIFSFileSystem.processProperties(POIFSFileSystem.java:538)
 at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:176)
at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:317)
 at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
at
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:59)
 at
com.axen.cirb.billchecker.business.impl.BillCheckerServiceImpl.checkBill(BillCheckerServiceImpl.java:70)
... 39 more

Any idea what's wrong?

Sébastien Arbogast

http://sebastien-arbogast.com
http://mooplan.com