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

--- Comment #9 from Theodor Mazilu <[email protected]> 2010-10-13 
03:11:04 EDT ---
Created an attachment (id=26165)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26165)
This is the xls file I tested with that threw the exception.

That is the xls file.

Here is a sample code that throws the exception I'll post at the bottom.
The stack trace is identical to the one posted by the creator of the thread.
poi-3.7-beta3-20100924.jar is the jar I have added to my classpath.

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class XlsError {
    public static void main(String[] args) {
        HSSFWorkbook workbook = null;
        FileInputStream fin = null;
        try {
            fin = new FileInputStream("capacityAnalysis.xls");
        } catch (FileNotFoundException fnf){
            fnf.printStackTrace();
        }
        try{
            POIFSFileSystem poifs = new POIFSFileSystem(fin);
            fin.close();
            workbook = new HSSFWorkbook(poifs);
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}



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 XlsError.main(XlsError.java:18)
Caused by: java.lang.RuntimeException: Did not expect to read NaN
    at
org.apache.poi.hssf.record.RecordInputStream.readDouble(RecordInputStream.java:276)
    at org.apache.poi.hssf.record.NumberRecord.<init>(NumberRecord.java:43)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to