We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Have Problem Convert to PDF application in container

Process: Conver PDF to PDF/A. Format type: PDF_A_1B
Version aspose: 21.6
Java:11
Code:

Blockquote
addAsposeLicense(“pdf”);

		try (var output = new ByteArrayOutputStream()) {
			// Convertendo para PDFA
			com.aspose.pdf.Document docPDF = new com.aspose.pdf.Document(inputStream, true);
			
			docPDF.validate("src/main/resources/Validation_log.xml", PdfFormat.PDF_A_1B);
			docPDF.convert("src/main/resources/Conversion_log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.None);

			docPDF.save(output);

			return new ByteArrayInputStream(output.toByteArray());
		}

Blockquote

File:
Teste.pdf (122.2 KB)

StackTrace:
org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[BEAFB11302DB13C-0000000000000000]
at org.apache.camel.CamelExecutionException.wrapCamelExecutionException(CamelExecutionException.java:45) ~[camel-api-3.9.0.jar!/:3.9.0]
at org.apache.camel.support.AbstractExchange.setException(AbstractExchange.java:564) ~[camel-support-3.9.0.jar!/:3.9.0]
at org.apache.camel.support.DefaultExchange.setException(DefaultExchange.java:27) ~[camel-support-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:288) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:146) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:780) ~[camel-core-processor-3.9.0.jar!/:3.9.0]
at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:688) ~[camel-core-processor-3.9.0.jar!/:3.9.0]
at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181) [camel-base-engine-3.9.0.jar!/:3.9.0]
at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:62) [camel-base-engine-3.9.0.jar!/:3.9.0]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:167) [camel-core-processor-3.9.0.jar!/:3.9.0]
at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:388) [camel-base-engine-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.aws2.sqs.Sqs2Consumer.processBatch(Sqs2Consumer.java:221) [camel-aws2-sqs-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.aws2.sqs.Sqs2Consumer.poll(Sqs2Consumer.java:118) [camel-aws2-sqs-3.9.0.jar!/:3.9.0]
at org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:190) [camel-support-3.9.0.jar!/:3.9.0]
at org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:107) [camel-support-3.9.0.jar!/:3.9.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[?:?]
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:189) ~[?:?]
at sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:208) ~[?:?]
at sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:72) ~[?:?]
at com.aspose.pdf.internal.l4y.l0v.lk(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v$2.lf(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l13v.lI.lb(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.lj(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4k.lI.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l1h.lc(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l1h.l2if(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Font.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Font.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.ld(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Resources.getFonts(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0u.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0u.lj(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0if.lk(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.ly.lf(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0if.l0l(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.ADocument.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Document.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.ADocument.validate(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Document.validate(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.portaldocumentos.assinador.processment.backoffice.component.ConvertComponent.convertPdfToPdfA(ConvertComponent.java:169) ~[classes!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:372) ~[camel-support-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:494) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:316) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:286) ~[camel-bean-3.9.0.jar!/:3.9.0]
… 18 more
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[?:?]
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:189) ~[?:?]
at sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:208) ~[?:?]
at sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:72) ~[?:?]
at com.aspose.pdf.internal.l4y.l0v.lk(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v$2.lf(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l13v.lI.lb(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.lj(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4k.lI.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l1h.lc(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l1h.l2if(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Font.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Font.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.ld(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Resources.getFonts(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0u.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0u.lj(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0if.lk(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.ly.lf(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0if.l0l(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.ADocument.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Document.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.ADocument.validate(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Document.validate(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.portaldocumentos.assinador.processment.backoffice.component.ConvertComponent.convertPdfToPdfA(ConvertComponent.java:169) ~[classes!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:372) ~[camel-support-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:494) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:316) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:286) ~[camel-bean-3.9.0.jar!/:3.9.0]
… 18 more
Caused by: java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262) ~[?:?]
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225) ~[?:?]
at sun.awt.FontConfiguration.init(FontConfiguration.java:107) ~[?:?]
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719) ~[?:?]
at sun.font.SunFontManager$2.run(SunFontManager.java:379) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at sun.font.SunFontManager.(SunFontManager.java:324) ~[?:?]
at sun.awt.FcFontManager.(FcFontManager.java:35) ~[?:?]
at sun.awt.X11FontManager.(X11FontManager.java:56) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84) ~[?:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[?:?]
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:189) ~[?:?]
at sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:208) ~[?:?]
at sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:72) ~[?:?]
at com.aspose.pdf.internal.l4y.l0v.lk(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v$2.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v$2.lf(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l13v.lI.lb(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l0v.lj(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4k.lI.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l1h.lc(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l4y.l1h.l2if(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Font.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Font.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.ld(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.FontCollection.(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Resources.getFonts(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0u.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0u.lj(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0if.lk(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.ly.lf(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.l0if.l0l(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.ADocument.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Document.lI(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.ADocument.validate(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.aspose.pdf.Document.validate(Unknown Source) ~[aspose-pdf-20.11-jdk17.jar!/:?]
at com.portaldocumentos.assinador.processment.backoffice.component.ConvertComponent.convertPdfToPdfA(ConvertComponent.java:169) ~[classes!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:372) ~[camel-support-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:494) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:316) ~[camel-bean-3.9.0.jar!/:3.9.0]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:286) ~[camel-bean-3.9.0.jar!/:3.9.0]
… 18 more

@lucas.alves

We have tested the shared file and sample code by setting up environment in MacOS Big Sur with Java 11. We have not been able to reproduce the issue on our end. I have added the snapshot for your convenience as well.

JavaImage.png (295.2 KB)