We have a bit more complex excel workbook, which we need to access. When accessing the workbook (new HSSFWorkbook(.)), the exception below is thrown. I found out that this happens, while the workbook is processed / read out and that on two different pages of the workbook (manually modified), the following section causes the exception if the value of 'rectype' is 93: Throwing code section: *********************** Class: RecordFactory.java Method: createRecord Condition to fail: rectype == 93 Code: retval = ( Record ) constructor.newInstance(new Object[] { new Short((short)rectype), new Short(size), data }); Thrown Exception: ****************** java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:232) at org.apache.poi.hssf.record.RecordFactory.createRecords (RecordFactory.java:160) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:165) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:132) at ScsRalfImporter.<init>(ScsRalfImporter.java:33) at ScsRalfImporter.main(ScsRalfImporter.java:66) Caused by: java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at org.apache.poi.hssf.record.UnknownRecord.<init> (UnknownRecord.java:62) at org.apache.poi.hssf.record.SubRecord.createSubRecord (SubRecord.java:57) at org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99) at org.apache.poi.hssf.record.Record.fillFields(Record.java:90) at org.apache.poi.hssf.record.Record.<init>(Record.java:55) at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:61) ... 10 more org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null at org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:246) at org.apache.poi.hssf.record.RecordFactory.createRecords (RecordFactory.java:160) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:165) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:132) at ScsRalfImporter.<init>(ScsRalfImporter.java:33) at ScsRalfImporter.main(ScsRalfImporter.java:66) Exception in thread "main"
Could you please attach the excel file that exhibits this error. It is almost impossible to say what's wrong without an example sheet.
No attachment added. Sorry cant do anything.