Bug 29992 - opening a excel workbook fails
Summary: opening a excel workbook fails
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: All All
: P3 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-09 07:35 UTC by R. K.
Modified: 2005-08-22 20:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description R. K. 2004-07-09 07:35:22 UTC
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"
Comment 1 Avik Sengupta 2004-11-18 16:15:08 UTC
Could you please attach the excel file that exhibits this error. It is almost
impossible to say what's wrong without an example sheet.
Comment 2 Jason Height 2005-08-23 04:53:16 UTC
No attachment added. Sorry cant do anything.