Summary: | Exception while reading by ExcelExtractor | ||
---|---|---|---|
Product: | POI | Reporter: | Yury Batrakov <batrakov> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 3.0-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: | Excel file that causes an exception |
We were running out of data processing the validation rules in one of the DVRecords For now, I've tweaked poi to issue a warning in this case, and carry on. Not sure if we'll then have garbage data validation rules then or not, but at least your file can be opened fine, and you ought to be able to get your text out (Fixed in SVN trunk) |
Created attachment 21657 [details] Excel file that causes an exception I'm using org.apache.poi.hssf.extractor.ExcelExtractor class for reading Excel files and I've got an exception below. Problem file is zipped and attached, I tried to minimize it's contents to make it easier to investigate, but I have no enough Excel knoweledge to figure out what field causes the problem :) Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:199) at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:117) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:207) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:259) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:240) at org.apache.poi.hssf.extractor.ExcelExtractor.<init>(ExcelExtractor.java:54) at org.apache.poi.hssf.extractor.ExcelExtractor.main(ExcelExtractor.java:66) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:187) ... 6 more Caused by: java.lang.ArrayIndexOutOfBoundsException at org.apache.poi.hssf.record.RecordInputStream.checkRecordPosition(RecordInputStream.java:132) at org.apache.poi.hssf.record.RecordInputStream.readShort(RecordInputStream.java:152) at org.apache.poi.hssf.util.HSSFCellRangeAddress.fillFields(HSSFCellRangeAddress.java:77) at org.apache.poi.hssf.util.HSSFCellRangeAddress.<init>(HSSFCellRangeAddress.java:65) at org.apache.poi.hssf.record.DVRecord.fillFields(DVRecord.java:207) at org.apache.poi.hssf.record.Record.<init>(Record.java:55) at org.apache.poi.hssf.record.DVRecord.<init>(DVRecord.java:134) ... 11 more