Cannot convert Word document to PDF in Java

Hi,

We are trying to use GroupDocs.Conversion to convert Word documents to PDF. We are doing this 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:

 Exception: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.groupdocs.conversion.internal.c.a.w.internal.ok
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.groupdocs.conversion.internal.c.a.w.internal.ok
	at com.groupdocs.conversion.internal.c.a.w.internal.oc.naj(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.internal.xG.a(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.internal.xG.ai(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.internal.xG.pt(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.internal.nY.os(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.zzCL.zzZKQ(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.zzCL.zzZRe(Unknown Source)
(...shortened for clarity...)
	at com.groupdocs.conversion.internal.c.a.w.zz8B.zzZDJ(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.zzZ4C.zzYOb(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.Document.updatePageLayout(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.Document.zzWw(Unknown Source)
	at com.groupdocs.conversion.internal.c.a.w.Document.getPageCount(Unknown Source)
	at com.groupdocs.conversion.contracts.documentinfo.WordprocessingDocumentInfo.<init>(Unknown Source)
	at com.groupdocs.conversion.documents.ae.<init>(Unknown Source)
	at com.groupdocs.conversion.documents.ae.<init>(Unknown Source)
	at com.groupdocs.conversion.loading.loaders.WordProcessingDocumentLoader.load(Unknown Source)
	at com.groupdocs.conversion.pipeline.g.a(Unknown Source)
	at com.groupdocs.conversion.Converter.convert(Unknown Source)
	at com.groupdocs.conversion.Converter.convert(Unknown Source)
	at com.groupdocs.conversion.Converter.convert(Unknown Source)

We are using the following Gradle dependency: compile("com.groupdocs:groupdocs-conversion:20.10.3")

We are using it with a working license (no free tier or trial).

Can you please help us? Are we missing another dependency of some sort?

Thanks for your time.

1 Like

@Tonyyy

Please share complete details/specifications for the remote Docker container that you’re using. We’d appreciate if you share a screencast/video that covers this issue and a simple application using that we could reproduce it at our end.

Hi, thanks for your reply.

While trying to provide a tiny sample application to reproduce the bug, we encountered another one… “vendorName == null!”

It’s a shame the Java examples in Github are all outdated, some of them even impossible to run.

Anyway, here’s what I’ve been able to produce: http://www.filedropper.com/demo_23

I perform the 3 following steps to simulate our new issue:

./gradlew clean build
docker build -t test:latest .
docker run test:latest

As always, thanks for your time.

@Tonyyy

In order to investigate this issue, we still need details/specifications on the remote Docker container that you’re working with. Additionally, we requested a video/screencast that coverts this issue. Could you please share that as well?

The sample application I provided contains a Dockerfile. This is all you need to get the information about the Docker container I’m running.

About the video/screencast, I’m sorry but I don’t see the point, the sample app is fairly quick to build and run to avoid requiring this.

@Tonyyy

We are investigating this scenario. Your investigation ticket ID is CONVERSIONJAVA-1205. You’ll be notified as there’s any update.

@Tonyyy

We couldn’t reproduce this issue at our end using the provided project. Could you please share a screencast?

The error message indicates that the GroupDocs.Conversion library is not able to find the com.groupdocs.conversion.internal.c.a.w.internal.ok class. This class is part of the GroupDocs.Conversion library, so it is likely that you are missing a dependency.

There are a few possible reasons why this dependency might be missing:

  • You are using an outdated version of the GroupDocs.Conversion library.
  • You are not using the correct dependency for your build system.
  • You have not installed the dependency correctly.

To troubleshoot the issue, you can try the following:

  1. Make sure that you are using the latest version of the GroupDocs.Conversion library. The current version is 20.11.0.
  2. Make sure that you are using the correct dependency for your build system. For Gradle, the dependency is compile("com.groupdocs:groupdocs-conversion:20.11.0") . For Maven, the dependency is com.groupdocs:groupdocs-conversion:20.11.0 .
  3. Make sure that you have installed the dependency correctly. For Gradle, you can run the following command to install the dependency:

gradle installDependencies

For Maven, you can run the following command to install the dependency:

mvn install

If you are still having trouble resolving the issue, please contact GroupDocs support for assistance.

@allanmax

Thank you for your input.