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 2014/10/17 09:21:27 UTC

[Bug 57104] New: org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

            Bug ID: 57104
           Summary: org.apache.poi.hssf.record.RecordInputStream$LeftoverD
                    ataException: Initialisation of record 0x5B left 1
                    bytes remaining still to be read.
           Product: POI
           Version: 3.10-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: simolidesai@gmail.com

I am trying to read from a Microsoft Excel 97-2003 Worksheet. There is no
problem opening the file using Microsoft Excel or Open Office. poi can read the
file once the file is opened and saved again in the same format. But i cannot
implement this practice for each file I encounter. I cannot attach the
problematic file because it has client information. Please help me with this.

The error I get is as follows:

org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
Initialisation of record 0x5B left 1 bytes remaining still to be read.
        at
org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:156)
        at
org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:231)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:480)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:301)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:264)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:199)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:342)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:323)

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
We need one file per problematic record type + bytes remaining combination.
While the exceptions look similar, the fix for each will be totally different

So, we need one for your "record type 0x5b + 1 byte remaining" case, and one
for your "record type 0x31 + 22 bytes remaining" case

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
Any chance of the file that shows the problem, so we can look at why POI isn't
knowing to read the whole record's data?

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

--- Comment #4 from Simoli Desai <si...@gmail.com> ---
I cannot provide you with the file for the other exception I get for record
0x5B left 1 bytes. Please use the file I have attached previously for the
following error. It is fine if you look into this error and ignore the previous
one because of lack of information.

Exception in thread "main"
org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
Initialisation of record 0x31 left 22 bytes remaining still to be read.
        at
org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:156)
        at
org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:231)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:480)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:301)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:264)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:199)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:342)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:323)

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #5 from Dominik Stadler <do...@gmx.at> ---
I tried to debug this, but when looking this up in the spec POI parses the
record correctly and it looks like this file is slightly off-standard and Excel
somehow ignores the additional content. 

Dev-Info: There are multiple [FONT] records which additional 22 bytes each. POI
seems to exactly follow the spec for FontRecord at "2.4.122 Font", but somehow
all the FONT-entries in this XLS file have 22 additional bytes. The value of
the first set of additional bytes is "13, 00, 01, 00, 00, 58, 01, 00, 00, 59,
5F, 29, 3F, 5F, 29, 3B, 5F, 28, 40, 5F, 29, 00".

Simoli, how exactly are these files produced? Via Excel or some other software
that automatically produces them?

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

--- Comment #2 from Simoli Desai <si...@gmail.com> ---
Created attachment 32119
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32119&action=edit
Problematic file

I found one more file with that gets me a similar error. I have attached it for
you.

It throws the same LeftoverDataException.

The error goes like this:


Exception in thread "main"
org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
Initialisation of record 0x31 left 22 bytes remaining still to be read.
        at
org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:156)
        at
org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:231)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:480)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:301)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:264)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:199)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:342)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:323)

-- 
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


[Bug 57104] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x5B left 1 bytes remaining still to be read.

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

--- Comment #6 from Simoli Desai <si...@gmail.com> ---
Hi Dominik,

It must be a third party software that generates these files.

By the way, the 22 bytes for FontRecord... can these be skipped?

There is this other library i used instead of POI because I had to get on with
my work, however I donot rely upon it completely. It parsed my file good. No
data fields were missing, it threw me an error message. That is all.

-- 
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