Created attachment 21756 [details] Test program The attached test program when run against the attached test file throws ClassCastException. Steps to reproduce: - Run attached test program with attached test file Actual result: - Program crashes with the following stack trace: Stack trace: java -cp lib/poi-3.0.2-FINAL-20080204.jar:. MinimalTest Exception in thread "main" java.lang.ClassCastException: org.apache.poi.hpsf.PropertySet cannot be cast to org.apache.poi.hpsf.DocumentSummaryInformation at org.apache.poi.POIDocument.readProperties(POIDocument.java:74) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:171) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:259) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:240) at MinimalTest.main(MinimalTest.java:7) Expected result: - The program should exit succesfully Exact POI version: poi-3.0.2-FINAL-20080204.jar
Created attachment 21757 [details] Test data
Additional information: - The test data is saved with a Debian OpenOffice.org 2.0.4.9 from Debian - If the test data is opened with OO.o 2.2.1 for Windows and resaved, POI can open it Is it just a broken file that OO.o can cope with for some reason? Even in that case ClassCastException is a bit rough :)
The sample code + spreadsheet work OK in the latest svn trunk. POIDocument.java must have changed since 3.0.2. Line 74 does not seem to correspond to the supplied stack trace. If you find the same problem on the latest trunk, please re-open this bug.
Hm yes, appparently some kind of fix for this was applied to trunk in r620582.