I am getting error while opening xl file. Here is my code FileInputStream inputStream = new FileInputStream("c:\\TEST1.xls"); HSSFWorkbook workbook = new HSSFWorkbook(inputStream); and ehere is exception I get 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:274) at org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:224) 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:212) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:193) at com.dreyfus.client.ExcelClient.go2(ExcelClient.java:23) at com.dreyfus.client.ExcelClient.main(ExcelClient.java:18) 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) ... 11 more Error org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance, the following exception occured: null
Created attachment 13829 [details] XL File that gives error This is the xl file that gives me error
I had attached the xls file that gives error
This excel sheet works fine with CVS HEAD as of 22Apr2005. Added file as a testcase (in o.a.p.hssf.usermodel.TestBugs) to prevent future regression