You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Jürgen Hoffmann <jh...@byteaction.de> on 2006/09/04 14:26:39 UTC

unable to open workbook

Hi All,

 

I am trying to open a workbook in excel 97 format, but when I try to open
it, I am getting:

java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)

        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224
)

        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

        at
de.byteaction.kabelbw.puek.ExcelConverter.doDatabaseImport(ExcelConverter.ja
va:513)

        at
de.byteaction.kabelbw.puek.ExcelConverter.main(ExcelConverter.java:226)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)

        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)

        at
org.codehaus.classworlds.boot.Bootstrapper.main(Bootstrapper.java:116)

Caused by: java.lang.ArrayIndexOutOfBoundsException

        at java.lang.System.arraycopy(Native Method)

        at
org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62)

        at
org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:57)

        at
org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99)

        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.ObjRecord.<init>(ObjRecord.java:61)

        ... 23 more

Exception in thread "main" java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)

        at
org.codehaus.classworlds.boot.Bootstrapper.main(Bootstrapper.java:116)

Caused by: 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.java:16
0)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

        at
de.byteaction.kabelbw.puek.ExcelConverter.doDatabaseImport(ExcelConverter.ja
va:513)

        at
de.byteaction.kabelbw.puek.ExcelConverter.main(ExcelConverter.java:226)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)

        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

        ... 6 more

 

Kind regards

 

Jürgen Hoffmann

 

 


AW: unable to open workbook

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi Jürgen.

It seems to be the wrong format, e.g. text but suffix .xls or a different
Excel format.

What does Excel tell you when you use "Save as"?

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: Jürgen Hoffmann [mailto:jh@byteaction.de] 
Gesendet: Montag, 4. September 2006 14:27
An: poi-user@jakarta.apache.org
Betreff: unable to open workbook

Hi All,

 

I am trying to open a workbook in excel 97 format, but when I try to open
it, I am getting:

java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)

        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224
)

        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

        at
de.byteaction.kabelbw.puek.ExcelConverter.doDatabaseImport(ExcelConverter.ja
va:513)

        at
de.byteaction.kabelbw.puek.ExcelConverter.main(ExcelConverter.java:226)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)

        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)

        at
org.codehaus.classworlds.boot.Bootstrapper.main(Bootstrapper.java:116)

Caused by: java.lang.ArrayIndexOutOfBoundsException

        at java.lang.System.arraycopy(Native Method)

        at
org.apache.poi.hssf.record.UnknownRecord.<init>(UnknownRecord.java:62)

        at
org.apache.poi.hssf.record.SubRecord.createSubRecord(SubRecord.java:57)

        at
org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:99)

        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.ObjRecord.<init>(ObjRecord.java:61)

        ... 23 more

Exception in thread "main" java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)

        at
org.codehaus.classworlds.boot.Bootstrapper.main(Bootstrapper.java:116)

Caused by: 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.java:16
0)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

        at
de.byteaction.kabelbw.puek.ExcelConverter.doDatabaseImport(ExcelConverter.ja
va:513)

        at
de.byteaction.kabelbw.puek.ExcelConverter.main(ExcelConverter.java:226)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)

        at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

        ... 6 more

 

Kind regards

 

Jürgen Hoffmann

 

 




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/