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 2011/06/28 06:15:30 UTC

DO NOT REPLY [Bug 51440] New: Unable to construct record instance

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

             Bug #: 51440
           Summary: Unable to construct record instance
           Product: POI
           Version: 3.7
          Platform: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: yuyj@yuyj.com
    Classification: Unclassified


Created attachment 27217
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27217
the excel file

Error occur when i deal excel 2003 files with poi.
(btw: the hssf.xls file is created by ms office 2003 directly.

and i use FileFormatConverters.exe Compatibility Pack for opening office2007
files.
http://www.microsoft.com/download/en/details.aspx?id=3

now i see FileFormatConverters.exe is the right reason why this error occur.
please see the picture attached.

The code like this: (hssf.xls as attached.)
=============================================================
import java.io.FileInputStream;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class PoiTest {
    public static void main(String[] args) {
        FileInputStream in;
        try {

            in = new FileInputStream("e:/hssf.xls");

            POIFSFileSystem f = new POIFSFileSystem(in);
            HSSFWorkbook wb = new HSSFWorkbook(f);

            System.out.println("ok");

        } catch (Exception e) {

            e.printStackTrace();
        }

    }

}

The exception as bellow:
=================================================================
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance
    at
org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:65)
    at
org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:300)
    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:442)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:263)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:188)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:170)
    at PoiTest.main(PoiTest.java:37)
Caused by: org.apache.poi.hssf.record.RecordFormatException: Expected to find a
ContinueRecord in order to read remaining 4 of 14 chars
    at
org.apache.poi.hssf.record.RecordInputStream.readStringCommon(RecordInputStream.java:353)
    at
org.apache.poi.hssf.record.RecordInputStream.readString(RecordInputStream.java:293)
    at org.apache.poi.hssf.record.SupBookRecord.<init>(SupBookRecord.java:96)
    at sun.reflect.GeneratedConstructorAccessor6.newInstance(Unknown Source)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at
org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:57)
    ... 8 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 51440] Unable to construct record instance

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

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
         OS/Version|                            |All

--- Comment #2 from Nick Burch <ni...@alfresco.com> 2011-06-28 10:22:48 UTC ---
Does the error still happen with POI 3.8 beta 3?

-- 
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 51440] Unable to construct record instance

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

--- Comment #1 from Yanjiang Yu <yu...@yuyj.com> 2011-06-28 05:43:30 UTC ---
Created attachment 27218
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27218
the end of the excel file.

the end of the two excel files.

-- 
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 51440] Unable to construct record instance

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

--- Comment #3 from Yanjiang Yu <yu...@yuyj.com> 2011-06-29 03:07:50 UTC ---
(In reply to comment #2)
> Does the error still happen with POI 3.8 beta 3?

YES

-- 
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 51440] Unable to construct record instance

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |INVALID

--- Comment #4 from Yegor Kozlov <ye...@dinom.ru> 2011-07-02 09:47:05 UTC ---
the problem is not reproducible with the latest build from trunk. 

Yegor

(In reply to comment #3)
> (In reply to comment #2)
> > Does the error still happen with POI 3.8 beta 3?
> 
> YES

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