You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/06/29 16:37:06 UTC

DO NOT REPLY [Bug 47448] New: org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

https://issues.apache.org/bugzilla/show_bug.cgi?id=47448

           Summary: org.apache.poi.hssf.record.RecordInputStream$LeftoverD
                    ataException: Initialisation of record 0x0 left 10
                    bytes remaining still to be read
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: max.valjanski@gmail.com


Exception on Excel file parsing (file attached)

Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected
RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@1cbfe9d
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:121)
    at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:85)
    at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:116)
    at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:57)
Caused by: org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
Initialisation of record 0x0 left 10 bytes remaining still to be read.
    at
org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:124)
    at
org.apache.poi.hssf.eventusermodel.HSSFRecordStream.getNextRecord(HSSFRecordStream.java:126)
    at
org.apache.poi.hssf.eventusermodel.HSSFRecordStream.nextRecord(HSSFRecordStream.java:93)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSSFEventFactory.java:141)
    at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:98)
    at
org.apache.tika.parser.microsoft.ExcelExtractor.parse(ExcelExtractor.java:145)
    at
org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:106)
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:119)
    ... 3 more

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448





--- Comment #1 from Maxim Valyanskiy <ma...@gmail.com>  2009-06-29 07:37:55 PST ---
Created an attachment (id=23899)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23899)
file that causes exception

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448





--- Comment #3 from Maxim Valyanskiy <ma...@gmail.com>  2009-06-30 03:28:38 PST ---
Thanx, now it works fine (patch included :-)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] [PATCH] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448





--- Comment #5 from Maxim Valyanskiy <ma...@gmail.com>  2009-06-30 03:43:56 PST ---
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

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] [PATCH] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448


Maxim Valyanskiy <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|org.apache.poi.hssf.record. |[PATCH]
                   |RecordInputStream$LeftoverD |org.apache.poi.hssf.record.
                   |ataException:               |RecordInputStream$LeftoverD
                   |Initialisation of record    |ataException:
                   |0x0 left 10 bytes remaining |Initialisation of record
                   |still to be read            |0x0 left 10 bytes remaining
                   |                            |still to be read




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448





--- Comment #2 from Josh Micich <jo...@gildedtree.com>  2009-06-29 12:30:49 PST ---
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.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448





--- Comment #4 from Maxim Valyanskiy <ma...@gmail.com>  2009-06-30 03:30:40 PST ---
Created an attachment (id=23909)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23909)
Solution

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47448] [PATCH] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x0 left 10 bytes remaining still to be read

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47448


Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #6 from Yegor Kozlov <ye...@dinom.ru>  2009-07-05 07:14:35 PST ---
Applied in r791251 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=791251 )

There is no junit, but your refactoring is well proved by existing tests so I
think it's OK for this fix to be checked in. 

Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org