poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arjan Gerritsen" <gerrit...@oblivion.nl>
Subject error opening (foreign) excel file
Date Tue, 09 Mar 2004 14:59:32 GMT
Hi all,
 
I have the following problem. I try to open an excel send to me by
another party. This is generated automaticly by an unkown source. I
can't open the file with poi. But I'm able to open it with Excel (all
versions). When I append some things in the file (make a row-width
larger, for example) and save it, poi can read it after that.

I'm using version poi-2.5-final-20040302.jar of poi on a windows system
for testing and the production environnement is linux, but on both
operating systems I get the same error. 

The error occurs in this line of code:
HSSFWorkbook workbook = new HSSFWorkbook(system);

This is the stacktrace of the error I get:
---------------------
java.lang.reflect.InvocationTargetException
        at
sun.reflect.GeneratedConstructorAccessor20.newInstance(Unknown Source)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
        at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java
:224)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.jav
a:160)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:165)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:132)
        at
nl.oblivion.microsoft.report.run.ImportReport.readXLS(ImportReport.java:
83)
        at
nl.oblivion.microsoft.mail.run.MessageHandler.handleAllMail(MessageHandl
er.java:214)
        at nl.oblivion.microsoft.mail.run.Apl.main(Apl.java:66)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 11
        at
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:491)
        at
org.apache.poi.util.LittleEndian.getInt(LittleEndian.java:139)
        at
org.apache.poi.hssf.record.BOFRecord.fillFields(BOFRecord.java:133)
        at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at
org.apache.poi.hssf.record.BOFRecord.<init>(BOFRecord.java:98)
        ... 10 more
org.apache.poi.hssf.record.RecordFormatException: Unable to construct
record instance, the following exception occured: null
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java
:237)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.jav
a:160)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:165)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:132)
        at
nl.oblivion.microsoft.report.run.ImportReport.readXLS(ImportReport.java:
83)
        at
nl.oblivion.microsoft.mail.run.MessageHandler.handleAllMail(MessageHandl
er.java:214)
        at nl.oblivion.microsoft.mail.run.Apl.main(Apl.java:66)
---------------------

I hope someone has a solution for this. I would be very appreciated. 
Thanx in advance. Arjan.

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


Mime
View raw message