Created attachment 27319 [details] files causing the problems In our application we process MS Outlook files (msg) with POIFS. With the file attached I get various exceptions: poi-3.2-FINAL {code} java.io.IOException: Cannot remove block[ 114 ]; out of range[ 0 - 23 ] at org.apache.poi.poifs.storage.BlockListImpl.remove(BlockListImpl.java:104) 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:524) at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:176) {code} POI-3.8 beta 3 and SVN trunk (rev. 1151057) {code} java.lang.ArrayIndexOutOfBoundsException: 0 at org.apache.poi.poifs.storage.SmallDocumentBlock.getDataInputBlock(SmallDocumentBlock.java:194) at org.apache.poi.poifs.filesystem.POIFSDocument.getDataInputBlock(POIFSDocument.java:282) at org.apache.poi.poifs.filesystem.ODocumentInputStream.getDataInputBlock(ODocumentInputStream.java:107) at org.apache.poi.poifs.filesystem.ODocumentInputStream.<init>(ODocumentInputStream.java:71) at org.apache.poi.poifs.filesystem.DocumentInputStream.<init>(DocumentInputStream.java:60) {code} I've also attached a code snippet to reproduce this behaviour. As this msg file is not produced by Outlook itself but by a 3rd party application, I'm not sure if there is a bug in POIFS or if the file is corrupt. The producer of this application argues that Outlook can open that file, so "it must be correct". Do you have a hint for me what might be the problem here or possibly a work around? Thanks a lot, Benjamin
Created attachment 27320 [details] code snippet to reproduce error
Any chance you could try with NPOIFSFileSystem from POI 3.8 beta 3? Rather than opening a POIFSFileSystem, open a NPOIFSFileSytem, and pass the root of that to HSMF. There's a fair chance it'll work with the new NPOIFS code where it may have previously failed for POIFS
Thank you for this hint. With the _N_POIFSFileSytem this file can be accessed. So I close this issue now and wait for the final release of POI 3.8 Best Regards, Benjamin