Could Not Save Slides to PDF in Java 17. Error: InvocationTargetException

Hi,

I am using Aspose.total with Developer OEM license.

  • With Aspose slides, I am trying to convert a PPTX file to PDF as follows :
 com.aspose.slides.LoadOptions loadOptions = new com.aspose.slides.LoadOptions();
 Presentation pres = new Presentation(GZIPInputStreamObject, loadOptions);
 pres.save(fileOutputStream, com.aspose.slides.SaveFormat.Pdf);
  • Previously, I am working with [java.version - 1.8.0_231]
    In [Java - 1.8], these PPTX to PDF conversion works as expected.
  • I am using the latest version of Aspose slides [22.7]
 <dependency>
 	<groupId>com.aspose</groupId>
 	<artifactId>aspose-slides</artifactId>
 	<version>22.7</version>
 	<classifier>jdk16</classifier>
 </dependency>
  • To check the performance in updated Java versions, I changed [Java.version - 17]
  • I’ve tested PPTX to PDF conversion with Aspose.Slides 22.7 and Java 17, it works fine in local Windows PC.

We are facing this issue only in server.

Operating System: Red Hat Enterprise Linux Server 7.9 (Maipo)
CPE OS Name: cpe:/o:redhat:enterprise_linux:7.9:GA:server
Kernel: Linux 3.10.0-1160.49.1.el7.x86_64
Architecture: x86-64

JAVA Version : 17.0.4 (openjdk-17)

  • Now, If I try to convert any PPTX file to PDF in server, the last line [pres.save()] throws the below error :

[ERROR MSG] Handler dispatch failed; nested exception is java.lang.InternalError: java.lang.reflect.InvocationTargetException
[ERROR CAUSE] java.lang.InternalError: java.lang.reflect.InvocationTargetException

Do I need to add any other configuration for later Java versions (JDK-17) ?

@dev.raz,
Thank you for describing the issue.

I’ve added a ticket with ID SLIDESJAVA-38916 to our issue tracking system. Our development team will investigate the case. We will inform you of any progress.

It would be great if you could share a full stack trace of the error.

@dev.raz,
Our developers requested the full stack trace of the error. Could you please share this information?

@Andrey_Potapov
Thank You for the immediate action.

I have attached below stack trace of the error as you requested.
Slides StackTrace.docx (7.4 KB)

@dev.raz,
Thank you for this information. I’ve forwarded it to our developers.

@dev.raz,
Our developers have investigated the case. As you can see, the main problem here is “Cannot load from short array because “sun.awt.FontConfiguration.head” is null”. This issue is related to the Linux configuration and can be resolved with the following commands:

yum install -y fontconfig
fc-cache --force

Please let us know if this helps you.

1 Like

@Andrey_Potapov

This issue has been resolved with above commands.
Thank you for your support.

@dev.raz,
We are glad to know that the issue has been resolved on your end. Thank you for using Aspose.Slides.