3

These are the steps that i do:

Save excel file. Run program that reads the excel file.

When i do those steps i get this error immediately:

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:224) at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:160) at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:163) at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:130) at

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.(Record.java:55) at org.apache.poi.hssf.record.BOFRecord.(BOFRecord.java:98) ... 12 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.java:160) at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:163) at org.apache.poi.hssf.usermodel.HSSFWorkbook.(HSSFWorkbook.java:130) at

When i do these steps i dont get the error:

Save excel file.

Open excel file.

Click on a cell.

Hit save.

Run program.

No error is thrown.

Does anyone know why this would be? It is very frustrating!!!!!

5
  • I'm going to hazard a guess: You're missing the library it's trying to reflect upon? shrug The stack trace doesn't tell us much. Commented Nov 15, 2010 at 19:41
  • but why would it go away after i open the file and save it? Commented Nov 15, 2010 at 19:42
  • 1
    Maybe there's a compatibility/format issue? Commented Nov 15, 2010 at 19:47
  • 1
    yeah maybe it comes in as a newer excel file and when i save it i save it as an older one or something... Commented Nov 15, 2010 at 19:50
  • Sorry, but there really is no way to help you. You've provided no code, and have only described the steps you've taken to produce the error. What does your program look like? How are you executing it? Commented Nov 15, 2010 at 20:01

2 Answers 2

2

1 of the scenario in poi 2.5.1 is,

If you select a data validation cell right before saving the excel document, you get the similar stack trace. The workaround would be to select simple text cell then proceed to save the document.

bug report filed, https://issues.apache.org/bugzilla/show_bug.cgi?id=50761

Sign up to request clarification or add additional context in comments.

Comments

0

This can be because of various reasons.

One I just found:

U will get this error, if excel has any filter enabled

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.