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 2008/03/18 21:07:30 UTC

DO NOT REPLY [Bug 43251] Unable to construct record instance, the following exception occured

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





--- Comment #2 from Lucas Shaw <lu...@hotmail.com>  2008-03-18 13:07:30 PST ---
Created an attachment (id=21679)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=21679)
An excel file that fails in the constructor with RecordFormatException: "Unable
to construct record instance"

Assuming xlsFile is a File object that points to the Problem.xls file the
following code fails:

inputStream_ = new FileInputStream( xlsFile );
POIFSFileSystem fs = new POIFSFileSystem( inputStream_ );
workbook_ = new HSSFWorkbook( fs ); //FAILS HERE

Here's a stack trace:
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record
instance
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:199)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:117)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:207)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:148)
        at com.snowfly.spincast.XlsSheetList.open(XlsSheetList.java:50)
        at com.snowfly.spincast.XlsSheetList.<init>(XlsSheetList.java:36)
        at
com.snowfly.spincast.client.XLSFileImporter.processFile(XLSFileImporter.java:63)
        at
com.snowfly.spincast.client.XLSFileImporter.doImport(XLSFileImporter.java:45)
        at com.snowfly.spincast.Task.process(Task.java:74)
        at com.snowfly.spincast.TaskManager.process(TaskManager.java:33)
        at com.snowfly.spincast.Spincast.main(Spincast.java:34)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:187)
        ... 10 more
Caused by: java.lang.IllegalArgumentException: Illegal length
        at
org.apache.poi.hssf.record.RecordInputStream.readCompressedUnicode(RecordInputStream.java:270)
        at
org.apache.poi.hssf.record.FileSharingRecord.fillFields(FileSharingRecord.java:62)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at
org.apache.poi.hssf.record.FileSharingRecord.<init>(FileSharingRecord.java:48)
        ... 15 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