Hi GroupDocs Team,
I am using the GroupDocs Conversion library in my linux docker image to convert the docx files to PDF and I am facing the below error / exception
RootCause: java.lang.RuntimeException: Fontconfig head is null, check your fonts or fonts configuration || StackTrace: class com.groupdocs.conversion.internal.c.a.ms.System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> java.lang.reflect.InvocationTargetException
--- End of inner exception stack trace ---
com.groupdocs.conversion.internal.c.a.ms.System.Reflection.b.N(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Reflection.b.invoke(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Reflection.ConstructorInfo.invoke(Unknown Source)
com.groupdocs.conversion.internal.c.a.ms.System.Activator.createInstance(Unknown Source)
com.groupdocs.conversion.loading.DocumentLoaderFactory.getLoader(Unknown Source)
com.groupdocs.conversion.converting.operations.ConversionOperationHelpers.convertToTarget(Unknown Source)
com.groupdocs.conversion.converting.operations.ToPdfConversionOperation.execute(Unknown Source)
com.groupdocs.conversion.converting.operations.ConvertToPdfIfRequiredFromPdfOptionsOperation.execute(Unknown Source)
com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
com.groupdocs.conversion.converting.operations.PagesLimitOperation.execute(Unknown Source)
com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
com.groupdocs.conversion.converting.operations.RemoveCommentsOperation.execute(Unknown Source)
com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
com.groupdocs.conversion.converting.operations.PreProcessWordProcessingDocumentOperation.execute(Unknown Source)
com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
com.groupdocs.conversion.pipeline.e.execute(Unknown Source)
com.groupdocs.conversion.pipeline.h.a(Unknown Source)
com.groupdocs.conversion.pipeline.h.a(Unknown Source)
com.groupdocs.conversion.b.convert(Unknown Source)
com.groupdocs.conversion.Converter.convert(Unknown Source)
com.groupdocs.conversion.Converter.convert(Unknown Source)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/java.lang.reflect.Method.invoke(Method.java:568)
org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:169)
org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:119)
org.springframework.kafka.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:56)
org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:356)
org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:92)
org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:53)
com.sfdc.industries.clm.pdfconversion.config.KafkaConfiguration.lambda$parallelKafkaConsumerRunner$0(KafkaConfiguration.java:103)
io.confluent.parallelconsumer.internal.UserFunctions.carefullyRun(UserFunctions.java:61)
io.confluent.parallelconsumer.ParallelEoSStreamProcessor.lambda$poll$0(ParallelEoSStreamProcessor.java:54)
io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.lambda$runUserFunctionInternal$15(AbstractParallelEoSStreamProcessor.java:1346)
io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:69)
io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.runUserFunctionInternal(AbstractParallelEoSStreamProcessor.java:1346)
io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.runUserFunction(AbstractParallelEoSStreamProcessor.java:1299)
io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.lambda$submitWorkToPoolInner$13(AbstractParallelEoSStreamProcessor.java:987)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base/java.lang.Thread.run(Thread.java:840)
at com.groupdocs.conversion.internal.c.a.ms.System.Reflection.b.N(Unknown Source)
at com.groupdocs.conversion.internal.c.a.ms.System.Reflection.b.invoke(Unknown Source)
at com.groupdocs.conversion.internal.c.a.ms.System.Reflection.ConstructorInfo.invoke(Unknown Source)
at com.groupdocs.conversion.internal.c.a.ms.System.Activator.createInstance(Unknown Source)
at com.groupdocs.conversion.loading.DocumentLoaderFactory.getLoader(Unknown Source)
at com.groupdocs.conversion.converting.operations.ConversionOperationHelpers.convertToTarget(Unknown Source)
at com.groupdocs.conversion.converting.operations.ToPdfConversionOperation.execute(Unknown Source)
at com.groupdocs.conversion.converting.operations.ConvertToPdfIfRequiredFromPdfOptionsOperation.execute(Unknown Source)
at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
at com.groupdocs.conversion.converting.operations.PagesLimitOperation.execute(Unknown Source)
at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
at com.groupdocs.conversion.converting.operations.RemoveCommentsOperation.execute(Unknown Source)
at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
at com.groupdocs.conversion.converting.operations.PreProcessWordProcessingDocumentOperation.execute(Unknown Source)
at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source)
at com.groupdocs.conversion.pipeline.e.execute(Unknown Source)
at com.groupdocs.conversion.pipeline.h.a(Unknown Source)
at com.groupdocs.conversion.pipeline.h.a(Unknown Source)
at com.groupdocs.conversion.b.convert(Unknown Source)
at com.groupdocs.conversion.Converter.convert(Unknown Source)
at com.groupdocs.conversion.Converter.convert(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:169)
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:119)
at org.springframework.kafka.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:56)
at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:356)
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:92)
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:53)
at com.sfdc.industries.clm.pdfconversion.config.KafkaConfiguration.lambda$parallelKafkaConsumerRunner$0(KafkaConfiguration.java:103)
at io.confluent.parallelconsumer.internal.UserFunctions.carefullyRun(UserFunctions.java:61)
at io.confluent.parallelconsumer.ParallelEoSStreamProcessor.lambda$poll$0(ParallelEoSStreamProcessor.java:54)
at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.lambda$runUserFunctionInternal$15(AbstractParallelEoSStreamProcessor.java:1346)
at io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:69)
at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.runUserFunctionInternal(AbstractParallelEoSStreamProcessor.java:1346)
at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.runUserFunction(AbstractParallelEoSStreamProcessor.java:1299)
at io.confluent.parallelconsumer.internal.AbstractParallelEoSStreamProcessor.lambda$submitWorkToPoolInner$13(AbstractParallelEoSStreamProcessor.java:987)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
... 46 more
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:87)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:75)
at java.desktop/sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:137)
at java.desktop/sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:156)
at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:76)
at com.groupdocs.conversion.internal.c.a.pd.internal.l6h.l0v.lv(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.l6h.l0v.<init>(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.l6h.l0v.<init>(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.l6h.l0v$2.lwI(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.l6h.l0v$2.lf(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.l14y.lI.lb(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.internal.l6h.l0v.lj(Unknown Source)
at com.groupdocs.conversion.internal.c.a.pd.FontRepository.getSources(Unknown Source)
at com.groupdocs.conversion.utils.common.FontsHelper.setForPdf(Unknown Source)
at com.groupdocs.conversion.loading.loaders.PdfDocumentLoader.<init>(Unknown Source)
... 51 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:85)
... 66 more
Caused by: java.lang.RuntimeException: Fontconfig head is null, check your fonts or fonts configuration
at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1271)
at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:224)
at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:106)
at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:706)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:358)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:315)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:315)
at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
... 72 more
Need some help on how to fix this.