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

Free Support Forum - aspose.com

Docker issues - document appears to be corrupted

Hi, I'm evaluating the product and I'm running into issues when attempting to package and deploy into docker. Outside of docker, the app runs perfectly fine; we're able to load and process documents successfully.

The following error occurs when we attempt to construct a document inside a docker container.

com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
at com.aspose.words.FileFormatUtil.zzZ(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.tlrg.UpdateFields.main(UpdateFields.java:75)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.aspose.words.zzYYK.zzZmS(Unknown Source)
at com.aspose.words.zzYYK.zzZmU(Unknown Source)
at com.aspose.words.zzYYK.zzzu(Unknown Source)
at com.aspose.words.zz5.zzTZ(Unknown Source)
at com.aspose.words.zz5.zzU0(Unknown Source)
at com.aspose.words.zzYYK.zzZmX(Unknown Source)
at com.aspose.words.zzYYK.zzZ(Unknown Source)
at com.aspose.words.zz73.visitSectionStart(Unknown Source)
at com.aspose.words.Section.zzZ(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Section.accept(Unknown Source)
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Document.accept(Unknown Source)
at com.aspose.words.zz73.zzZ(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
... 29 more

Here is an example of the code that errors:

public class UpdateFields {
protected void main(String[] args) throws Exception {
Document doc;
try {
doc = new Document("C://document.docx");
doc.save("c://updateddoc.docx", SaveFormat.DOCX);
} catch (Exception e) {

Hi Chloe,

Thanks for your inquiry. We will appreciate it if you please create a simple Word document from scratch to double check that Aspose.Words for Java is configured correctly in Docker, using latest version of Aspose.Words for Java. However, if the issue persists then please share the steps which you are using for Docker container to reproduce this issue at our end. We will investigate the issue at our side and provide you more information.

Best Regards,

Hi Tilal,

We tried creating a variety of documents for the purpose of testing and diagnosing the problem to no avail. We are on the latest version of Aspose.Words (17.4.0). We do have another very similar class in the app that uses a different document library which works perfectly when deployed with docker.

The dockerfile is as follows:

FROM java

WORKDIR /usr/src

ADD ./build/libs/App.jar /usr/src/start.jar

CMD java -jar start.jar


Build and run, post to the app to trigger the construction of a document and you get the error.

Hi Chloe,

Thanks for your feedback. I am configuring the environment at our my end for investigation of the issue and will update you my findings soon.

Best Regards,

Hi Tilal, have you got any updates on this?

Hi Chloe,

Thanks for your patience. We have tested Aspose.Words for Java in Docker container and noticed the reported exception. We have logged a ticket WORDSJAVA-1572 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

Hi Tilal,

Thanks for that. Please do let us know about the progress of this.


Hi Chloe,

Thanks for your inquiry. I am afraid the issue is still pending for investigation in the queue. We will notify you as soon as some update is available.

Best Regards,

I had a similar issue with loading a Word document: code which worked fine outside of a docker container would throw com.aspose.words.FileCorruptedException when running inside of a docker container. Adding “ENV LC_ALL en_US.UTF-8” to the Dockerfile fixed this issue.

– John

Hi John,

Thank you very much for sharing your findings. Our product team will definitely consider it during the issue investigation to fix the reported exception.

Best Regards,