Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

POI Excel RecordFormatException

843789Oct 11 2009 — edited Oct 11 2009
I'm getting a recordformatexception when I try to open an excel file using poi. My class works with other xls files, but the one I want to use crashes at runtime. Maybe someone can decipher the stack trace and help me out.

Stack Trace
Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Una
ble to construct record instance
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.j
ava:186)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.
java:328)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:2
71)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
96)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
78)
        at ExcelGenerator.<init>(ExcelGenerator.java:40)
        at ExcelGenerator.main(ExcelGenerator.java:30)
Caused by: java.lang.RuntimeException: resource 'functionMetadata.txt' not found

        at org.apache.poi.hssf.record.formula.function.FunctionMetadataReader.cr
eateRegistry(FunctionMetadataReader.java:58)
        at org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry.
getInstance(FunctionMetadataRegistry.java:41)
        at org.apache.poi.hssf.record.formula.function.FunctionMetadataRegistry.
getFunctionByIndex(FunctionMetadataRegistry.java:57)
        at org.apache.poi.hssf.record.formula.FuncPtg.<init>(FuncPtg.java:42)
        at org.apache.poi.hssf.record.formula.Ptg.createClassifiedPtg(Ptg.java:1
04)
        at org.apache.poi.hssf.record.formula.Ptg.createPtg(Ptg.java:85)
        at org.apache.poi.hssf.record.formula.Ptg.readTokens(Ptg.java:54)
        at org.apache.poi.hssf.record.FormulaRecord.<init>(FormulaRecord.java:20
2)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.j
ava:184)
        ... 6 more
Press any key to continue . . .
Edited by: dbillings on Oct 11, 2009 4:57 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2009
Added on Oct 11 2009
2 comments
874 views