- Code: Select all
ByteArrayOutputStream output = null;
InputStream templateInputStream = new ByteArrayInputStream(docxBytes);
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(templateInputStream);
output = new ByteArrayOutputStream();
Docx4J.toPDF(wordMLPackage, output);
The above code seems to work fine when i run it on my local Windows machine. Unfortunately the same code when deployed on a kubernetes pod throws following exception:
java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: org.docx4j.fonts.fop.apps.FOPException: java.io.FileNotFoundException: .docx4j (Permission denied)
java.io.FileNotFoundException: .docx4j (Permission denied) [in ...