Aspose cells causes jvm crash?

Here’s a class that compiles:

import com.aspose.cells.Workbook;
public class test {

public static void main( String[] args ) {
try {

String fn = “foo.xls”;
Workbook doc = new Workbook( fn );
fn += “.pdf”;
doc.save( fn );
}
catch( Exception e ) {
e.printStackTrace();
}
}
}

However, when I attempt to run it:

% java -classpath aspose-cells-7.3.1.jar:. test
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fc027278530, pid=28093, tid=140463258949376
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot™ 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x508530] unsigned+0x180
#
# An error report file with more information is saved as:
# /home/kurt/Downloads/Aspose/aug_12/hs_err_pid28093.log
#
# If you would like to submit a bug report, please visit:
# Bug Report
#
Aborted (core dumped)


I figured there might be some dependency on the other jars that ship with cells, so I also tried:

java -classpath aspose-cells-7.3.1.jar:woodstox-core-asl-4.1.1.jar:dom4j-1.6.1.jar:stax2-api-3.0.2.jar:bcprov-jdk16-146.jar:. test
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f74d023b530, pid=27979, tid=140139676534528
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot™ 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x508530] unsigned+0x180
#
# An error report file with more information is saved as:
# /home/kurt/Downloads/Aspose/aug_12/hs_err_pid27979.log
#
# If you would like to submit a bug report, please visit:
# Bug Report
#
Aborted (core dumped)


This is how it is compiled:

% javac test.java -classpath aspose-cells-7.3.1.jar

This doesn’t appear to be dependent on the input file. In fact, I get the same result when I use an empty file created with “touch foo.xls”.





Hi,



Thanks for your posting and using Aspose.Cells for Java.



Please try setting java.awt.headless=true before running your code and see if it gets crashed or not.



Please note the red line below.



Java

System.setProperty("java.awt.headless", "true");
CellsHelper.setFontDir(fontDir);
Workbook book = new Workbook("foo.xls");

//Rest of your code.

//........
book.save("foo.pdf");

That fixed it.

Thanks.

Hi,

Thanks for sharing your feedback. It’s great to know that your issue is resolved.

Also you could try JVM option java.awt.headless=true or Aspose.Cells.Disable=SunFontManager when starting your application, it should solve your issue.

Command example:
java -DAspose.Cells.Disable=SunFontManager …