Bug 50761 - in POI 2.5.1, excel file with data validation cell selected, throw java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62 )
Summary: in POI 2.5.1, excel file with data validation cell selected, throw java.lang....
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-10 22:37 UTC by Lee Seng
Modified: 2013-08-05 12:05 UTC (History)
0 users



Attachments
To replicate the issue (469.50 KB, application/vnd.ms-excel)
2011-02-10 22:37 UTC, Lee Seng
Details
simple text cell selected, no issue (469.00 KB, application/vnd.ms-excel)
2011-02-10 22:39 UTC, Lee Seng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Seng 2011-02-10 22:37:29 UTC
Created attachment 26638 [details]
To replicate the issue

excel file with data validation cell selected, throw 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:5
7)
        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)
        at org.apache.poi.hssf.dev.BiffViewer.createRecord(BiffViewer.java:587)
        at org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:114)

        at org.apache.poi.hssf.dev.BiffViewer.run(BiffViewer.java:72)
        at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:649)

If i select simple text cell before saving the excel file, the exception gone away. I'm using Excel 2002 SP3.
Comment 1 Lee Seng 2011-02-10 22:39:58 UTC
Created attachment 26639 [details]
simple text cell selected, no issue
Comment 2 Lee Seng 2011-02-10 22:43:00 UTC
Following stack trace will be displayed for HSSF workbook opening.


 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:163)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:210)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
.
.
.
.
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)
        ... 69 more



and


 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:237)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:210)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
Comment 3 Yegor Kozlov 2011-02-11 03:11:01 UTC
POI 2.5.1 is six years old! Lots of bugs have been fixed since then. Please try the latest stable release POI-3.7. 

Yegor
Comment 4 Lee Seng 2011-02-11 03:26:22 UTC
Hi, Yegor,
What are the info required to fix this issue?
does poi 3.7 runs in jdk 1.4?
Comment 5 Yegor Kozlov 2011-02-11 05:44:08 UTC
(In reply to comment #4)
> Hi, Yegor,
> What are the info required to fix this issue?
> does poi 3.7 runs in jdk 1.4?

POI 3.7 requires JDK 1.5. The last release supporting JDK 1.4 was POI 3.2 released in Oct 2008.

I recommend you to upgrade to the latest and greatest POI 3.7, it a huge step forward as compared to the version 2.5.

Yegor
Comment 6 Dominik Stadler 2013-08-05 12:05:01 UTC
no response in a long time => resolving for now, please reopen with more information if this is still an issue