We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error while saving Workbook

Hi,

I am using Aspose.Cells1.9.5.18 for java 1.4.

I have one issue while saving the workbook.

The issue log is given below

java.lang.IndexOutOfBoundsException: Index: 22, Size: 22
at java.util.ArrayList.RangeCheck(ArrayList.java:507)
at java.util.ArrayList.get(ArrayList.java:324)
at com.aspose.cells.cj.a(Unknown Source)
at com.aspose.cells.cj.y(Unknown Source)
at com.aspose.cells.cj.(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at devtest.AsposeTest.main(AsposeTest.java:48)
Exception in thread “main”

I have attached the simulation program for replicating the same issue.

Please update on cause and fix of this issue ASAP.

Thank You.
Kailas

Hi Kailas,

Thanks for providing us the template file with sample code.

Yes, we found the issue after an initial test, we will figure it out soon.

Thank you.

Hi Kailas,

Thank you for your file and code. I think it is created by Aspose.Cells too. After checking, I found there is some error records in this "NxsnhlVMJQ.xls", would you please give us the original file and your code to create this "NxsnhlVMJQ.xls"? That will help us trace the root cause of this issue, thank you.

Hi Jhonson,

Yes this XLS has been created by using Aspose.Cells. I can not give you the code as it is not a single or two classes. It is complete application which is generating this XLS.

Can you please provide information about what kind of error records you found?

Thank You.
Kailas

Hi Kailas,

In this file some style records being lost or some rows/cells' style index has been written improperly. It is really strange, and it will be hard for us to find the cause without reproduceable template and code. Anyway, we will check it more and try to catch such Exception so the workbook can be saved normally. Anytime any hint about this issue such as your template file or process of creating such a result file(especially how to set Styles) will be appreciated.

Hi Jhonson,

Appreciate your quick response.

If the processing of setting style is causing this issue, then this issue should have thrown while saving all other excels also. But it is throwing it only for this excel.

I am attaching one more workbook which is getting saved properly using the same program.

Thank You.
Kailas

Hi Kailas,

Yes, most files generated by Aspose.Cells have no such issue, in fact, it is the first result file with such strange issue that we encountered. It is really strange and hard to figure the cause out. Anyway, we have handled such abnormal records thus the workbook can be saved successfully, please try this attached fix. For the cause of such issue, any further information if you find will be appreciated, thank you.

The attached fix does not help to resolve the issue. We continue to get an exception:

java.lang.NullPointerException
at com.aspose.cells.cj.a(Unknown Source)
at com.aspose.cells.cj.b(Unknown Source)
at com.aspose.cells.cj.w(Unknown Source)
at com.aspose.cells.cj.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)

One of the information that could help you is that, tha above exception is raised when the application executes the code on a Weblogic 8.1 Express installed on Sun Solaris. The error does not appear when executed on a windows machine for the exactly same data set which the application processes.

------------------------------------------------------------

Java version:
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

Weblogic version:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3
Created-By: 1.4.2_04-b05 (Sun Microsystems Inc.)
Main-Class: weblogic.Server
Implementation-Vendor: BEA Systems
Implementation-Title: WebLogic Server 8.1 SP4 Mon Nov 29 16:21:29 PST
2004 471647
Implementation-Version: 8.1.4.0
Class-Path: wlcipher.jar webservices.jar xmlx.jar ojdbc14.jar jconn2.j
ar jConnect.jar EccpressoAsn1.jar EccpressoCore.jar EccpressoJcae.jar
ant/ant.jar ant/optional.jar ant/jakarta-oro-2.0.7.jar ../../common/
perf/java/dirig.jar ../../common/perf/java/dsJMX.jar ../../common/per
f/java/AgtMX.jar wlbase.jar wlutil.jar wlsqlserver.jar wldb2.jar wlsy
base.jar wloracle.jar wlinformix.jar

------------------------------------------------------------

Could you also provide a debug version of teh jar, so that there can be an additional information logged for futher analysis?

The application is currently in production and your help in resolving the issue will be very much appreciated.

Hi,

Please use this attached version and send us the Exception trace info, thank you.

Attached is the stack trace.

java.lang.NullPointerException
at com.aspose.cells.cj.a(SourceFile:1472)
at com.aspose.cells.cj.b(SourceFile:1101)
at com.aspose.cells.cj.w(SourceFile:853)
at com.aspose.cells.cj.a(SourceFile:128)
at com.aspose.cells.Workbook.save(SourceFile:819)
at com.aspose.cells.Workbook.save(SourceFile:759)

Hi,

It is so strange, does it occurs when save the file "NxsnhlVMJQ.xls"? Please use this debug version and send us the result information, this version will print out those cells that may cause such issue. Thank you.