Summary: | [PATCH] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read | ||
---|---|---|---|
Product: | POI | Reporter: | Maxim Valyanskiy <max.valjanski> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | xyang200 |
Priority: | P2 | ||
Version: | 3.5-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
file that causes exception
Solution |
Description
Maxim Valyanskiy
2009-06-29 07:37:05 UTC
Created attachment 23899 [details]
file that causes exception
I am pretty sure that the file you have has non-zero padding bytes which was the cause for bug 46987. Unfortunately, the fix for that bug was in a different class (RecordFactory) and in your case the problem occurs in HSSFEventFactory/HSSFRecordStream. The problem is with record iteration boundary checking logic, and the ideal solution would be to refactor the existing code in RecordFactory so that HSSFEventFactory can use it too. You can re-save the file in Excel and that should correct the problem. This may be a work-around if you don't have too many files that are affected. Thanx, now it works fine (patch included :-) Created attachment 23909 [details]
Solution
Please copy "src/java/org/apache/poi/hssf/eventusermodel/HSSFRecordStream.java" to "src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java" before appying patch and remove "src/java/org/apache/poi/hssf/eventusermodel/HSSFRecordStream.java" after apply |