Bug 28136 - POI 2.5 throws RecordFormatException on complex MS Excel spreadsheet
Summary: POI 2.5 throws RecordFormatException on complex MS Excel spreadsheet
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-FINAL
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-01 17:28 UTC by Jelai Wang
Modified: 2006-08-27 03:52 UTC (History)
1 user (show)



Attachments
MS Excel spreadsheet generated by BRB ArrayTools (489.00 KB, application/octet-stream)
2004-04-01 17:29 UTC, Jelai Wang
Details
short Java program to exercise the bug (316 bytes, text/plain)
2004-04-01 17:29 UTC, Jelai Wang
Details
capture of exception trace (1.88 KB, text/plain)
2004-04-01 17:30 UTC, Jelai Wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jelai Wang 2004-04-01 17:28:37 UTC
Attached to this bug report is a MS Excel spreadsheet, Project.xls, that is
generated by a program called BRB ArrayTools.  It parsed without complaint in
POI 1.5.1, but in POI 2.5 it throws the following exception:

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:165)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:212)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:193)
	at test.TestProject.main(TestProject.java:9)
Exception in thread "main" 

I will attach Project.xls, TestProject.java (exercises the bug), and out.txt
(capture of the entire trace for the exception).

-jw
Comment 1 Jelai Wang 2004-04-01 17:29:22 UTC
Created attachment 11086 [details]
MS Excel spreadsheet generated by BRB ArrayTools
Comment 2 Jelai Wang 2004-04-01 17:29:54 UTC
Created attachment 11088 [details]
short Java program to exercise the bug
Comment 3 Jelai Wang 2004-04-01 17:30:12 UTC
Created attachment 11089 [details]
capture of exception trace
Comment 4 asehbai 2004-04-06 20:23:37 UTC
I think this is the same bug as the one I submitted a week ago, bug# 27929. The 
problem with the xls file is the drop-down lists. I simplified my problem 
spreadsheet to just a simple drop-down list on one sheet and got the same 
exception.

As a workaround, I modified the POI source to catch and ignore this particular 
exception, but this is obviously not a fix.
Comment 5 Jelai Wang 2004-04-07 22:06:19 UTC
Nice find!  My spreadsheet definitely has drop down lists, I may have some time
in the next few days to take a closer look and try to corroborate what you are
saying.  At least we can potentially mark one of these bug reports as a dupe,
although at a glance, the exception does not appear to be the same as yours.

In either case, I'm not in a position right now to fix this bug myself, so the
best I can do is provide good evidence and research for someone who _is_ in that
position.  :-)

-jw
Comment 6 Michael Zalewski 2004-06-04 01:54:08 UTC
I have submitted a patch to fix bug 27929. If you apply that patch, the 
attached spreadsheet will work fine.

I verified this patch on your sample file. So this bug can be marked duplicate.
Comment 7 Jason Height 2006-08-27 10:52:20 UTC
As indicated by Michael, the bug is now corrected. This Bug just needs to be
closed, which i am doing .... NOW

Jason