Bug 47701

Summary: POI 3.5 beta 7 can not read excel file contain list box (Form Control)
Product: POI Reporter: Thang Nguyen <nguyenhongthangnl>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: this is the file to test for list box contain.

Description Thang Nguyen 2009-08-18 01:42:40 UTC
Created attachment 24143 [details]
this is the file to test for list box contain.

Hi EveryOne,

POI 3.5 beta 7 can't read an excel file (Office 2007) this contain 

a listbox Form Control. ( You can download excel attach file to run this test)

This is error message when I'm use poi read excel file:

Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException:
Unable to construct record instance
    at
org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:65)
    at
org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:264)
    at
org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:267)
    at
org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:233)
    at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:378)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:277)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:202)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:318)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:299)
    at OFFCE129.main(OFFCE129.java:16)
Caused by: java.lang.RuntimeException: Unexpected end-of-file
    at
org.apache.poi.util.LittleEndianInputStream.checkEOF(LittleEndianInputStream.java:123)
    at
org.apache.poi.util.LittleEndianInputStream.readUShort(LittleEndianInputStream.java:118)
    at
org.apache.poi.hssf.record.SubRecord$LbsDataSubRecord.<init>(SubRecord.java:165)
    at org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:58)
    at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:92)
    at sun.reflect.GeneratedConstructorAccessor14.newInstance(Unknown Source)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at
org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:57)
    ... 9 more

Please help me a solution for this bug, 

If everyone has any Ideas, Please help me.

Thanks,
Comment 1 Yegor Kozlov 2009-12-02 02:56:21 UTC
Fixed in r886113

Yegor