Cannot convert document to PDF in Spring Boot

Hi

I am using GroupDocs.Conversion to convert documents to PDF in a Spring Boot Java application.

When we run locally the JAR, everything works as expected. When we try to convert from the remote Docker container, we get the following issue:

ERROR #1
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.groupdocs.conversion.internal.c.a.i.internal.jK.n
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)

ERROR #2
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:503)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)

Configurations:
Gradle 6.4 - compile(“com.groupdocs:groupdocs-conversion:21.10”)
JAVA: openjdk 11.0.10 2021-01-19
GroupDocs Conversion: 21.10
Docker image: adoptopenjdk/openjdk11-openj9:alpine-jre

I am loading the fileBytes of a storage and returning a data stream to the microsservice, this is implementation:

InputStream in = new ByteArrayInputStream(fileBytes);
Converter converter = new Converter(in);
PdfConvertOptions options = new PdfConvertOptions();
File generatedFile = File.createTempFile(fileId, “.pdf”);
OutputStream out = new FileOutputStream(generatedFile);
converter.convert(out, options);

We intend to purchase a paid version, we only depend on the resolution of this bug to proceed with the purchase process

@barberino

Could you please share the sample application? Also share the steps to reproduce this issue.

@Atir_Tahir

This is the sample application: GitHub - barberino/demo-group-docs: Demo - GroupDocs.Conversion

In github are steps to reproduce this issue.

@barberino

We’re investigating this issue. Your investigation ticket ID is CONVERSIONJAVA-1485.

@Atir_Tahir

Do you have a deadline for this ticket?

@barberino

This issue is still under investigation. As we’ve any ETA of fix, we’ll notify you.

@barberino

This issue is fixed in API version 22.1.