Bug 32822 - Error opening XL file with InputStream
Summary: Error opening XL file with InputStream
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC Windows 2000
: P1 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-23 08:27 UTC by password
Modified: 2005-04-22 03:41 UTC (History)
0 users



Attachments
XL File that gives error (23.00 KB, application/vnd.ms-excel)
2004-12-23 08:29 UTC, password
Details

Note You need to log in before you can comment on or make changes to this bug.
Description password 2004-12-23 08:27:58 UTC
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
Comment 1 password 2004-12-23 08:29:07 UTC
Created attachment 13829 [details]
XL File that gives error

This is the xl file that gives me error
Comment 2 password 2004-12-23 08:30:08 UTC
I had attached the xls file that gives error
Comment 3 Avik Sengupta 2005-04-22 11:41:05 UTC
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