Java core on file

I receive java core, when I try to load document into library(file is attached).
I understand that it is not directly related to library, rather it is some kind of problem of environment.
I have posted it hear hoping that you’ve faced with similar problems and may suggest what can possibly be causing these cores.
The strange thing about this situation is that we have environment with the same OS and the same set of fonts, which doesn’t have any problems.
Below is relevant snippet taken from core log:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j sun.font.FontManager.getFontPath(Z)Ljava/lang/String;+0
v ~StubRoutines::call_stub
J sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
J sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
j com.aspose.cells.a.d.co.o()V+60
j com.aspose.cells.a.d.co.(Z)V+41
j com.aspose.cells.WorkbookSettings.(Lcom/aspose/cells/Workbook;I)V+291
j com.aspose.cells.Workbook.a(Lcom/aspose/cells/b/a/d/m;Lcom/aspose/cells/LoadOptions;Z)V+14
j com.aspose.cells.Workbook.(Ljava/io/InputStream;)V+116


Environment information with core:
# uname -a
Linux stg-ui3.aws 2.6.18-348.3.1.el5xen #1 SMP Mon Mar 11 20:28:48 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.9 (Final)
Release: 5.9
Codename: Final

Environment information, which doesn’t experience problems:
# uname -a
Linux bamboo.aws 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.9 (Final)
Release: 5.9
Codename: Final

Hi,

Thank you for using Aspose.Cells for Java. Please use following JVM option when starting your java application to avoid such kind of issue:
-DAspose.Cells.Disable=SunFontManager

-DAspose.Cells.Disable=SunFontManager
It is not working. Doesn’t disable sun.font.FontManager.
I have added it and still have the same java core.
Debugged it on local machine and see that library with this flag still access sun.font.FontManager.
Using aspose-cells-7.4.3.

Tried upgrade/downgrade library version and see if this flag works there.
7.4.3.5 /7.3.5 - doesn’t work there as well.
Listed environment properties just before the passing InputStream to library and can see that parameter is not filtered somewhere and indeed present:
– listing properties –
java.runtime.name=Java™ SE Runtime Environment
sun.boot.library.path=C:\Program Files (x86)\Java\jdk1.6.0_…
java.vm.version=20.4-b02
Aspose.Cells.Disable=SunFontManager
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
path.separator=;
java.vm.name=Java HotSpot™ Client VM
file.encoding.pkg=sun.io
user.country=US
sun.java.launcher=SUN_STANDARD

Hi,

It should take effect if you add the correct property and value pair to JVM option. Or please use the following code in your application before referring to any class/API of Aspose.Cells:

System.setProperty("Aspose.Cells.Disable", "SunFontManager");

Or please try another jvm option:

-Djava.awt.headless=true

to check whether they can work on your end.

Thank you.

JVM option is set and present, but library still make calls to to sun.font.FontManager.
Please see the video.
I cast it from run on my machine.
Thanks for cooperation

Hi,

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

It is very strange that those options take no effect for your application. All other users with the same problem can solve it by adding those options. Would you please print out the version of aspose.cells in your code to make sure you have been using the right one? Such as add one line like following:

System.getProperties().list(System.out);
System.out.println(CellsHelper.getVersion());
Workbook ...

Sure. See attached.

Hi,

To trace the issue, we have added some debug information for attached debug version. Would you please try it and send us the output of your application?

Thank you.

Could you tell me how exactly do you log additional information?
We use log4j in project. Just in case turned on debug logging for log4j, but nothing there as well (also I did not recall Aspose.Cells documentation stating usage of this library).
I don’t see anything new in logs, except for the fact that FontManager is called only one time, when document is loaded into file.
– listing properties –
java.runtime.name=Java™ SE Runtime Environment
sun.boot.library.path=C:\Program Files (x86)\Java\jdk1.6.0_…
java.vm.version=20.4-b02
Aspose.Cells.Disable=SunFontManager
java.vm.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
path.separator=;
java.vm.name=Java HotSpot™ Client VM
file.encoding.pkg=sun.io
user.country=US
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=Service Pack 1
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\Projects\SmartLling\SVN\branch\web…
java.runtime.version=1.6.0_29-b11
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files (x86)\Java\jdk1.6.0_…
os.arch=x86
java.io.tmpdir=C:\Users\User\AppData\Local\Temp<br>line.separator=

java.vm.specification.vendor=Sun Microsystems Inc.
user.variant=
os.name=Windows 7
sun.jnu.encoding=Cp1251
java.library.path=C:\Program Files (x86)\Java\jdk1.6.0_…
java.specification.name=Java Platform API Specification
java.class.version=50.0
sun.management.compiler=HotSpot Client Compiler
os.version=6.1
user.home=C:\Users\User
user.timezone=Europe/Helsinki
java.awt.printerjob=sun.awt.windows.WPrinterJob
file.encoding=UTF-8
java.specification.version=1.6
user.name=User
java.class.path=C:\Program Files (x86)\JetBrains\Inte…
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=C:\Program Files (x86)\Java\jdk1.6.0_…
sun.java.command=com.intellij.rt.execution.junit.JUnit…
java.specification.vendor=Sun Microsystems Inc.
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode
java.version=1.6.0_29
java.ext.dirs=C:\Program Files (x86)\Java\jdk1.6.0_…
sun.boot.class.path=C:\Program Files (x86)\Java\jdk1.6.0_…
java.vendor=Sun Microsystems Inc.
java.awt.headless=true
file.separator=<br>java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport…
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m…
7.5.0.0D
Method ‘sun.font.FontManager.getFontPath()’ entered at sun.font.FontManager.getFontPath(FontManager.java:-1)
Method breakpoint reached. Method ‘sun.font.FontManager.getFontPath()’ is about to exit at sun.font.FontManager.getFontPath(FontManager.java:-1)
Let me know if I can help somehow and thank you for persisting with this investigation.

Hi,


Thank you for your feedback. It is so strange that no any additional message be output with the debug version. We just added code to show some messages(System.out.println()) before using sun.font.FontManager. If we find the options of Aspose.Cells.Disable or java.awt.headless, code of using FontManager.getFontPath() should be ignored. Otherwise we will print out message such as “No property value found for Aspose.Cells.Disable” and some other messages about system properties.

Guys, I am willing to chat with someone directly, lets say in Skype and can arrange remote desktop connection via join-me.
Let me know if that is an option for you.
Because I have no idea why debug version of library is not printing anything.

I did not see any additional log string, because options were present.
I just removed -DAspose.Cells.Disable=SunFontManager -Djava.awt.headless=true from VM options and can see now:
No property value found for Aspose.Cells.Disable. Try it again and result is: null
No property value found for java.awt.headless. Try it again and result is: null

When I put them back messages disappear, but there is still one invocation to
FontManager.getFontPath()

Hi,

Thank you for your feedback about the debug message. It seems those JVM options have been detected successfully but cannot prevent the invocation of SunFontManager. It is really a strange behavior for your enviornment. Anyways, we will change the logic of checking and using SunFontManager to see whether it can help to solve your issue. We will try to provide you a fix ASAP, maybe early next week.

Thank you.

Hi,


Please try the attached latest version/fix: Aspose.Cells for Java v7.5.0.1 if it fixes your issue.

Let us know your feedback.

Thank you.

Unfortunately it did not resolve the issue - I still have java core on the machine and can see that sun.font.FontManager is used on my machine.
Attached video.

Is there anything else you could advise to do?
We have set up all the machines with equal set of fonts, but that didn’t resolve the problem. Still having java cores on some of them.
At the moment I am stuck. We can’t release code into production with library which might cause java-cores. I would really appreciate help.
Thanks

Hi,


We will get back to you soon (hopefully tomorrow).

Sorry for any inconvenience caused!

Hi,


Would you please try the jar for Jdk14? You can download the official release V7.5.0 and get the corresponding jar from the “JDK 1.4” directory in the archive. For the version for Jdk14, we disable the SunFontManager directly without checking the jvm options.

We also built another debug version to trace the issue too. Same with the prior one, we print some messages before the calling of SunFontManager. Please try it to check whether you can get those debug messages.

If the debug version cannot work for you and no debug message be shown when calling SunFontManager, would you please create a simple console application to execute without the web server environment to see whether you can get different result. The test code in the console application can just be:
Workbook wb = new Workbook(template);

Thank you.

It seems that switching to library version of Jdk14 helped.
I can still see calls to FontManager on my local environment, but java cores from other machines disappeared.
Thanks for the help.