Bug 48332 - Unable to read Excel file
Summary: Unable to read Excel file
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-FINAL
Hardware: Other Linux
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 11:50 UTC by vdhanda
Modified: 2009-12-02 13:30 UTC (History)
1 user (show)



Attachments
BiffViewer output (90.82 KB, text/plain)
2009-12-02 11:50 UTC, vdhanda
Details
The Excel (15.50 KB, application/vnd.ms-excel)
2009-12-02 11:52 UTC, vdhanda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vdhanda 2009-12-02 11:50:55 UTC
Created attachment 24661 [details]
BiffViewer output

I have an Excel file that POI is not able to read.  MS Excel and OpenOffice can read it.  Attached is the BiffViewer output.  The Excel was created by another process using SoftArtisans OfficeWriter for Excel 7.0.0.1642 (http://officewriter.softartisans.com).

I really need to read this file via POI.  Please help.
Comment 1 vdhanda 2009-12-02 11:52:28 UTC
Created attachment 24662 [details]
The Excel
Comment 2 Josh Micich 2009-12-02 11:55:06 UTC
Can you please attach the stack-trace of your error?  Also, can you investigate whether re-saving the file with Excel allows POI to read it?
Comment 3 vdhanda 2009-12-02 11:59:36 UTC
Hello Josh,

Yes, if I open and save the file in Excel and/or OpenOffice, the POI can read it.  

The stack trace from BiffViewer is at the bottom of the BiffViewer output.  Here's the stack trace from my application.

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:64)
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:263)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:270)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:236)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:377)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:275)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:200)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:182)
	at com.epistemic.http.ExcelHandler.handleResponseBody(ExcelHandler.java:126)
	at com.aexp.pl.Tester.main(Tester.java:17)
Caused by: java.lang.RuntimeException: Unusual record size remaining=(0)
	at org.apache.poi.hssf.record.ColumnInfoRecord.<init>(ColumnInfoRecord.java:72)
	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:56)
	... 9 more
Comment 4 Josh Micich 2009-12-02 13:30:14 UTC
Fixed in svn r886311

junits added