Free Support Forum - aspose.com

Can not find TXO content when opening a workbook in Cells for Java

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We have received your file via email. I checked your file and I found no problem in opening the file using Aspose.Cells for Java V2.1.0.19. Also as I checked the file you sent is the same as you sent before. Please confirm us if you are having the problem in the same file you sent in the mail.

Thank You & Best Regards,

Hi,

Yes we are still having the problem with the file we sent in the email. Attempting to read the file "ANF COH_Model.xlsx" returns in the following error message:

java.io.IOException caught: It is not a valid excel2007 file.chartSpace root element error
java.io.IOException: It is not a valid excel2007 file.chartSpace root element error
at com.aspose.cells.Workbook.open(Unknown Source)

We get this error message with v2.1.0.19 and the new version 2.1.0.20

(We are now logging the version of Aspose when the application starts up so we can absolutely confirm which version is in use. )

-Nancy

Hi Nancy,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Well, we checked your provided file with the latest versions V2.1.0.19 & V2.1.0.20 and we did not get any issue while opening the file. Please provide us complete details about your environment (OS, JDK version etc) and provide us your sample code to reproduce the issue and we will check it soon.

Thank You & Best Regards,

Hi Nausherwan,

I am using Windows XP Professional, JDK 1.6.0_14. We get the same results on Windows Server 2003 SP2.

Attached is a file with sample code that produces the error. When I run the attached, here are my results:

com.jovus.erpro.server.excel.test.TestAsposeOpenExcelFile
Connected to the target VM, address: '127.0.0.1:1374', transport: 'socket'
TestAsposeOpenExcelFile.openWorkBook()caught: It is not a valid excel2007 file.chartSpace root element error
java.io.IOException: It is not a valid excel2007 file.chartSpace root element error
at com.aspose.cells.Workbook.open(Unknown Source)
at com.jovus.erpro.server.excel.test.TestAsposeOpenExcelFile.openWorkBook(TestAsposeOpenExcelFile.java:57)
at com.jovus.erpro.server.excel.test.TestAsposeOpenExcelFile.main(TestAsposeOpenExcelFile.java:23)

Finished verifying C:\data\Projects-Dev\ANF COH_Model.xlsx, isvalid = false

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for providing your sample code and environment details.

After further testing your issue, we found that the issue is caused when you use a file name with space in it (in your file there is an empty space after ANF), your specified file format is Excel2007 and the file is in some folder in the directory (like C:\Test\ ANF COH_Model2.xlsx) rather than on the root of directory i.e. C:\ ANF COH_Model2.xlsx. We will check it and fix it soon. As a work around you can simply remove the space from the file and it will work fine.

Thank You & Best Regards,

Hello,

We would like to know when a fix for this issue will be available.

Thanks very much.

Hi,

We are working on your issue, we will let you know when it is resolved.

Thanks for your patience.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Well, after further looking into the issue, we think that issue is not with Aspose.Cells for Java. The issue might be with some Java Runtime Environment installation and after reinstalling the JRE on one of our test system (which was generating the issue as per the following post: https://forum.aspose.com/t/71345 ) the issue got resolved. So may be you can try re-installing the JRE at your end and check if it fixes the issue.

Thank You & Best Regards,

Hi,

It is somewhat confusing to me that the resolution is to reinstall the JRE. Can you please elaborate:

If the problem was with the JRE installation, how did you install the JRE the first time vs. the second time?

Or was it a different version of the JRE installed the second time? What versions of the JRE did you test with?

Did you test with the Word file that has a space in the filename?

Did you test by putting the Word2007 doc with space in the filename in a subdirectory?(your post noted that it works in a root directory but not a subdirectory.)

In your post #200549 you noted this is only an issue with Word2007. Why is this an issue with Word2007 and not Word2003?

Thanks.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Well, It’s a very strange issue and we are not very sure about the cause of it. The Java installation was done with the same installer (means same version). May be some update has caused the issue. Please see the attached screen shot for Java version installed on our test machine now. As I said earlier that it can be a possiblity that your issue may have been caused by some issue with the Java installation, so you may try to re-install it and confirm if the issue is resolved or not. As we are unable to re-produce the issue on any of our test machine any more with any of the file format and we don’t think this issue is caused by Aspose.Cells for Java.

Thank your for your support,

Thanks very much for the additional information.

We will do more testing especially with JRE 1.6.0_16 and get back to you on our results probably end of next week.

The issues you have found earlier (filed as 10750) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

We have tested with the Aspose.Cells for Java version 2.1.1 with Java 1.6.0_16, and we are still getting the error:

It is not a valid excel2007 file.chartSpace root element error
java.io.IOException: It is not a valid excel2007 file.chartSpace root element error
at com.aspose.cells.Workbook.open(Unknown Source)

I will send to you the excel file that causes this error in an email.

Thanks for your help.

Hi,

Thank you for considering Aspose.

We have received your template file via email. We will look into your issue and get back to you soon.

Thank You & Best Regards,

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We have tested your files with both JDK1.5 and JDK1.6 and did not find any issue. I am also attaching the latest version so you may try it and let us know if it works fine for you.

Thank You & Best Regards,

Hi,

I have tried with the jar file you posted. Same error:

file.chartSpace root element error
at com.aspose.cells.Workbook.open(Unknown Source)

Why do we see this error and you do not? Are you using some other method to open the file?

At one point I think you were getting an error (not sure if it was this error or a different one) if you read the xlsx file in a subdirectory rather than a root directory. We are reading the fi;le from a directory like this:

C:\TomcatApps\JovusApplication\WEB-INF\upload\temp\ANF COH_Model.xlsx

Is the the case where you can read it successfully from a root directory but not from a subdirectory?

Thanks for you continued assistance in this matter.

Hi,

Thank you for considering Aspose.

Well, that issue was not caused by Aspose.Cells. That was some issue with Java Runtime Environment installation and after reinstalling the JRE on one of our test system (which was generating the issue) the issue got resolved. So may be you can try re-installing the JRE at your end (if possible) and check if it fixes the issue.

Thank You & Best Regards,

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We still do not know why we cannot reproduce the issue here. But we have removed some codes for checking XML elements when reading Excel2007 template files. Please try the attached latest fix to check whether it fixes your issue.

Thank You & Best Regards,