Bug 57897 - RecordFormatException: Unable to construct record instance
Summary: RecordFormatException: Unable to construct record instance
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.12-FINAL
Hardware: PC All
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2015-05-07 12:37 UTC by Adithya
Modified: 2023-08-07 16:03 UTC (History)
1 user (show)

Excel File and error stack trace (9.84 KB, application/x-rar)
2015-05-07 12:37 UTC, Adithya

Note You need to log in before you can comment on or make changes to this bug.
Description Adithya 2015-05-07 12:37:37 UTC
Created attachment 32721 [details]
Excel File and error stack trace

WorkbookFactory.create(is) (Where is input stream) is throwing an error.(using an xls file) On looking up the error, I found Bug 50779 which suggested that it has been fixed...Tried downloading the 3.11 Final version but still get the same error..

org.apache.poi.hssf.record.RecordFormatException: Not enough data (1) to read requested (2) bytes

On just opening the file and saving it without any modifications and keeping the file type as xls only, the problem appears to go away...So some wierd characters might be causing the issue..

Attached the xls file and the complete error strack trace.

Appreciate a quick turnaround !!!
Comment 1 Nick Burch 2015-05-07 13:00:51 UTC
Any chance you could re-test with the POI 3.12 release candidate, and see if it's fixed in that newer version? https://dist.apache.org/repos/dist/dev/poi/
Comment 2 Adithya 2015-05-08 13:05:22 UTC

I tested it with the latest 3.12 version and I can confirm that the issue still exists.
Comment 3 Adithya 2015-05-15 07:34:12 UTC
Is anyone looking into this ??
Comment 4 Nick Burch 2015-05-15 08:38:26 UTC
I am sorry that the free support you receive from a community of volunteers for some software that is free isn't as fast as you would like. If only you had the source code for the software, so you could investigate it yourself! Or a workaround! Oh, wait...
Comment 5 Adithya 2016-05-17 06:03:23 UTC
Can anyone please suggest if this issue has been fixed and if yes , what version is it ?
Comment 6 Javen O'Neal 2016-05-17 09:46:01 UTC
Feel free to write a unit test for this. If it's fixed in the latest version but not fixed in a previous version (or vice versa), you could use a tool look git-bisect to find the version that fixed (or broke) this issue.

In general, the best way to see a bug resolved to your liking is to put in a proportional amount of effort, which includes doing a majority of the leg work developing necessary tests to prove existing functionality is incorrect, proposing patches, then using those tests to prove the patch is correct. Downloading the POI source code, setting up eclipse, and building and testing the code is pretty straightforward.