Font and Border Color problems

Hello,

I’m using Aspose.Cells 16.12.0 version and when I try to save a worksheet, thread gets stuck.

java.lang.Thread.State: RUNNABLE
at sun.lwawt.macosx.LWCToolkit._jr$jni$loadNativeColors(Native Method)
at sun.lwawt.macosx.LWCToolkit.loadNativeColors(LWCToolkit.java)
at sun.lwawt.macosx.LWCToolkit.loadSystemColors(LWCToolkit.java:142)
at java.awt.SystemColor.updateSystemColors(SystemColor.java:473)
at java.awt.SystemColor.(SystemColor.java:465)
at com.aspose.cells.a.c.zh.(Unknown Source)
at com.aspose.cells.Font.setColor(Unknown Source)
at com.aspose.cells.ztw.b(Unknown Source)
at com.aspose.cells.zvj.h(Unknown Source)
at com.aspose.cells.zvj.c(Unknown Source)
at com.aspose.cells.zvi.a(Unknown Source)
at com.aspose.cells.zcab.a(Unknown Source)
at com.aspose.cells.zcab.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)

This happens when I try to create a border with color specified or a font with or without a color specified.

Is there anything I can do to prevent this issue?

@umutsezgin,

Thanks for providing us error trace.

Could you try using our latest version/fix if it makes any difference: Aspose.Cells for Java v17.7.5:

If you still find the issue with v17.7.5, kindly do provide us sample JAVA program (runnable) and template (if any) to reproduce the issue on our end, we will check it soon.

Thank you.

I’m not using a template when I get this error.

When I tried using 17.X versions, I had this issue at workbook init.

Workbook wb = new Workbook();

java.lang.Thread.State: RUNNABLE
at sun.lwawt.macosx.LWCToolkit._jr$jni$loadNativeColors(Native Method)
at sun.lwawt.macosx.LWCToolkit.loadNativeColors(LWCToolkit.java)
at sun.lwawt.macosx.LWCToolkit.loadSystemColors(LWCToolkit.java:142)
at java.awt.SystemColor.updateSystemColors(SystemColor.java:473)
at java.awt.SystemColor.(SystemColor.java:465)
at com.aspose.cells.a.c.zh.(Unknown Source)
at com.aspose.cells.zalw.e(Unknown Source)
at com.aspose.cells.zalw.d(Unknown Source)
at com.aspose.cells.zalw.a(Unknown Source)
at com.aspose.cells.zalw.a(Unknown Source)
at com.aspose.cells.zrc.f(Unknown Source)
at com.aspose.cells.zrc.(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)

@umutsezgin,

I am afraid, we got to reproduce the issue on our end, so, please do provide us or paste a sample JAVA program (runnable) to reproduce the issue on our end, we will check it soon.

Thank you.

That is the strange part, when I try with a standalone program, opening and saving the files is not a problem. What I am having trouble with is to use Aspose.Cells in our GWT project. I don’t think a runnable version of a gwt jar will do you much good.

@umutsezgin,

Well, to figure out your issue, we have to reproduce your issue on our end. We have no definite clue by just seeing the error trace why you are getting this issue in you project. We appreciate if you could separate the issue from the project and create a sample Java program to show the issue. You may also give us your environment details, e.g OS, JDK vendor and version, any other settings, etc.

Thank you.

@umutsezgin

Thanks for using Aspose APIs.

For this issue, please try to access java.awt.SystemColor directly without reference to Aspose.Cells to see whether this class can work for your environment.

Sample Code:

System.out.println(SystemColor.scrollbar);
System.out.println(SystemColor.desktop);

Hello Shakeel,

I have found the root cause of this problem. When “-XstartOnFirstThread” argument is used in VM arguments, the thread freezes at “at sun.lwawt.macosx.LWCToolkit._jr$jni$loadNativeColors(Native Method)”, but it seems this argument is needed for GWT applications when working on MacOS. I removed the argument and Aspose.Cells is working now, I haven’t seen a negative result of removing this argument, but I need to test the system more to be sure.

@umutsezgin

Thanks for using Aspose APIs.

It is good to know that you are in process of sorting out this issue. Hopefully, you will not get any negative results and will be able to resolve this issue completely. In case, you face any issue, please feel free to let us know, we will be glad to look into it and help you out.