Bug 48180 - Error reading Excel document that contains charts
Summary: Error reading Excel document that contains charts
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: unspecified
Hardware: PC Mac OS X 10.4
: P2 normal with 4 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-11 12:03 UTC by jason.mckim
Modified: 2009-11-25 05:35 UTC (History)
1 user (show)



Attachments
Excel sheet with simple chart (20.50 KB, application/octet-stream)
2009-11-11 12:03 UTC, jason.mckim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jason.mckim 2009-11-11 12:03:18 UTC
Whenever I attempt to read the attached document (via Workbook.create(FileInputStream)) I received the exception below:
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record instance
	at org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:71)
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:269)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:409)
	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 org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:60)
Caused by: org.apache.poi.hssf.record.RecordFormatException: Not enough data (0) to read requested (6) bytes
	at org.apache.poi.hssf.record.RecordInputStream.checkRecordPosition(RecordInputStream.java:185)
	at org.apache.poi.hssf.record.RecordInputStream.readFully(RecordInputStream.java:250)
	at org.apache.poi.hssf.record.RecordInputStream.readFully(RecordInputStream.java:246)
	at org.apache.poi.hssf.record.chart.ChartEndBlockRecord.<init>(ChartEndBlockRecord.java:44)
	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:513)
	at org.apache.poi.hssf.record.RecordFactory$ReflectionRecordCreator.create(RecordFactory.java:63)
	... 40 more
Comment 1 jason.mckim 2009-11-11 12:03:56 UTC
Created attachment 24519 [details]
Excel sheet with simple chart
Comment 2 Nick Burch 2009-11-25 04:12:11 UTC
Some of your chart records were shorter than they are supposed to be, I wonder if the file comes from something other than excel?

I've made POI more tolerant of the appropriate records missing some of their data, and POI can now open your file without error. Fix in r884065.
Comment 3 Matthew Sgarlata 2009-11-25 05:35:59 UTC
The file was created in Office 2008 for Mac