Summary: | [Urgent] ArrayIndexoutofbounds Exception. POI - Version 1.8 | ||
---|---|---|---|
Product: | POI | Reporter: | gvdinesh <gvdinesh> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | clay |
Priority: | P1 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | sample excel file |
Description
gvdinesh
2002-12-10 12:15:25 UTC
do NOT reassign bugs to me. This information is NOT enough to debug and/or solve this problem. Please attach problem .xls and the minumum amount of (compilable) code needed to replicate this issue. We can then try and resolve this issue. Also, to reiterate, assigning bugs to individuals in a voluteer project is presumptious, to say the least. Created attachment 4141 [details]
sample excel file
Hi, Added attachment file. This file even fails read. Sorry for assigning the bug to Andy. Thanks, Dinesh Hi, I tried to trace through the code. In littleEndian.java private static long getNumber(final byte[] data, final int offset, final int size) the data length is smaller than offset+size-1 and the for loop there fails. So it is giving a error while executing the attached file. Any insights into it. Thanks, Dinesh This is fixed and awaiting commit Fixed. comitted to both branch and head. will go into 2.0pre3 release. I am still having this problem with 2.0-pre3. I have about twenty Excel files, all seemingly the same (structurally) and I am batch processing them with Ant, and running to this error on half to three quarters of them. Here is a stack trace: [excel] java.lang.reflect.InvocationTargetException [excel] at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) [excel] at sun.reflect.NativeConstructorAccessorImpl.newInstance (Unknown Source) [excel] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (Unknown Source) [excel] at java.lang.reflect.Constructor.newInstance(Unknown Source) [excel] at org.apache.poi.hssf.record.RecordFactory.createRecord (RecordFactory.java:257) [excel] at org.apache.poi.hssf.record.RecordFactory.createRecords (RecordFactory.java:193) [excel] at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:207) [excel] at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init> (HSSFWorkbook.java:174) [excel] at com.etg.ant.ExcelTask.execute(ExcelTask.java:90) [excel] at com.etg.ant.ExcelTask.execute(ExcelTask.java:61) [excel] at org.apache.tools.ant.Task.perform(Task.java:319) [excel] at org.apache.tools.ant.Target.execute(Target.java:309) [excel] at org.apache.tools.ant.Target.performTasks(Target.java:336) [excel] at org.apache.tools.ant.Project.executeTarget(Project.java:1306) [excel] at org.apache.tools.ant.Project.executeTargets (Project.java:1250) [excel] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:569) [excel] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:367) [excel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [excel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [excel] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [excel] at java.lang.reflect.Method.invoke(Unknown Source) [excel] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:335) [excel] at org.eclipse.ui.externaltools.internal.ant.launchConfigurations.AntLaunchDelegate $1.run(AntLaunchDelegate.java:172) [excel] at java.lang.Thread.run(Unknown Source) [excel] Caused by: java.lang.ArrayIndexOutOfBoundsException: 11 [excel] at org.apache.poi.util.LittleEndian.getNumber (LittleEndian.java:529) [excel] at org.apache.poi.util.LittleEndian.getInt (LittleEndian.java:177) [excel] at org.apache.poi.hssf.record.BOFRecord.fillFields (BOFRecord.java:170) [excel] at org.apache.poi.hssf.record.Record.fillFields(Record.java:127) [excel] at org.apache.poi.hssf.record.Record.<init>(Record.java:92) [excel] at org.apache.poi.hssf.record.BOFRecord.<init> (BOFRecord.java:135) [excel] ... 24 more I am looking into whether I can permission to give you one of the files that is bombing out, but that may take a little longer, and may not be allowable. *sorry, not my call* :( Clay, This particular problem IS fixed.. as proof, there is a testcase (test15228 in TestBugs.java), that failed prior to the fix, and works now (2.0pre3). So your problem is different.. and we will we able to help you only if you give a small test sheet and the minimum code to replicate this. If you have a problem providing the sheet, try replicating the problem with dummy data. As I said earlier, this particular bug IS fixed, there is a testcase to prove it. Clay, if you are still having a problem, please attach an exmaple sheet and the minimum amount of code reqd to fix the problem. |