Facing problem using examples

Hi ,

While evaluating aspose.cells ,I am trying to use aspose-cells-8.0.0.jar to convert xls/xlsx files to html files… I have imported examples as a project into my eclipse. I have converted some file using Dashboard but when I try to do it through java code , jvm crash takes place every time(refer to attachment). The same is working for aspose.words and aspose.slide. Please look into it on urgently.

Thanks,
Ajay

Hi,


Well, I think you may simply create a new project in eclipse, add Aspose.Cells for Java v8.0.x jars (from respective “\lib” folder @ your installation directory) to your class path, write your codes using Aspose.Cells APIs, compile and run it, it should work fine.

Let us know if I can be of any further help.

Thank you.

Hi ,

I have done it previously.I have attached the code as attachment to the reply. Inside the code snippet it throws exception at
wb.save(dataDir + “Originalxls.html”, sv);

line.
workbook object reference is created in the previous line successfully i.e. aspose.cells.8.0.0 library is already added in the class-path. Do we need to add some more jar libraries to execute it?

Hi,


Well, you need both jars in the “…\lib” folder to be set into your classpath. We appreciate if you could create a separate stand alone JAVA program/application in eclipse and share it with us, we will check it soon. Also, as some classes (with same names) are present in multiple products, you got to instantiate or create the class objects using full qualified names, e.g
com.aspose.cells.Workbook workbook = new com.aspose.cells.Workbook();


Thank you.

Hi,

PFA project zip file.

Thanks.

Please note that the file mentiond in the programmersguide.asposecells.workingwithfiles.utilityfeatures.convertingtomhtmlfiles.java.ConvertingToMHTMLFiles.java file exists.


Thanks.

Hi,


We recommend you to kindly do try our latest version/fix: Aspose.Cells for Java v8.0.1.4

I tested the sample code in a separate JAVA program with the following codes using v8.0.1.4, it works absolutely fine.
Here is the complete JAVA runnable class code here I used.
e.g
Sample code:


//Specify the file path - I copied the file from your mentioned folders

String filePath = “f:\Files\Book1.xlsx”;

//Specify the HTML saving options
HtmlSaveOptions sv = new HtmlSaveOptions(SaveFormat.HTML);
Workbook wb = null;
//Instantiate a workbook and open the template XLSX file
wb = new Workbook(filePath);
//Save the MHT file
wb.save(“f:\files\Originalxlsx1.html”, sv);

// Print message
System.out.println(“Excel to HTML conversion performed successfully.”);

Please find attached the intput Excel file and output MHTML file for your reference.


We also recommend you to kindly download the

I am still facing the same issue. Could it be due to Centos 5 as OS? The same code is working on Aspose Dashboard installed on windows machine.


Thanks.

Hi,


What is the error you get on Centos 5 OS when using the above code segment with the provided file.

Thank you.

The same error which I sent you in the first reply as an attachment.


Here is the summary of the error.

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00002b20c12adf00, pid=28179, tid=47419688159552
#
# JRE version: 6.0_32-b03
# Java VM: Java HotSpot™ 64-Bit Server VM (20.7-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x508f00] unsigned+0x180
#
# An error report file with more information is saved as:
# /root/Desktop/aspose_related/AsposeXlsConverter/hs_err_pid28179.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

I have attached the log file again.

Thanks,
Ajay


Hi,


Well, your issue might be due to the fact that some classes of Aspose.Cells have been instantiated in your specific web environment before your settings of headless takes effect. Would you please set this property in the command line when you are starting your web server? the command line should be like following:
java ... –Djava.awt.headless=true ...


Let us know if you still find the issue.

Thank you.