I downloaded poi-3.0-rc4 created a simple xls file using OpenOffice started org/apache/poi/hpsf/examples/CopyCompare passing the example xls on the command line. This resulted in jvm termination with java.lang.NegativeArraySizeException thrown from line 251 of VariantSupport.java Running CopyCompare in the eclipse debugger I see that org/apache/poi/hwpf/usermodel/Section.java assigns a negative value to ple.length and passes it to new Property which winds up in VariantSupport which in turn tries to size an array based on this negative value. Stack Trace: Exception in thread "main" java.lang.NegativeArraySizeException at org.apache.poi.hpsf.VariantSupport.read(VariantSupport.java:251) at org.apache.poi.hpsf.Property.<init>(Property.java:163) at org.apache.poi.hpsf.Section.<init>(Section.java:281) at org.apache.poi.hpsf.PropertySet.init(PropertySet.java:454) at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:249) at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java:61) at org.apache.poi.hpsf.examples.CopyCompare$CopyFile.processPOIFSReaderEvent(CopyCompare.java:359) at org.apache.poi.poifs.eventfilesystem.POIFSReader.processProperties(POIFSReader.java:261) at org.apache.poi.poifs.eventfilesystem.POIFSReader.read(POIFSReader.java:97) at org.apache.poi.hpsf.examples.CopyCompare.main(CopyCompare.java:139)
Created attachment 20391 [details] Input file The file (bzipped) which caused the exception
Will have a look at it.
The error is in the data: property set stream is larger than it claims to be. I added a consistency check to the code base which throws an appropriate exception. If you generated your file with a recent OpenOffice.org release, you should file a bug report for it.
*** This bug has been marked as a duplicate of bug 45583 ***