Hello Aspose Support Team,
I recently upgraded Aspose.PDF from version 24.9 to 24.12 in my Java project and am encountering an issue when running tests in a headless CI environment (GitHub Actions).
The tests work fine locally but fail in CI with the following errors:
Test Name: ConcreteM365CalendarFileTest > Test Get Text from html with Aspose pdf
Error Message: java.lang.ExceptionInInitializerError at ConcreteM365CalendarFileTest.java:51
Caused by: java.awt.HeadlessException at ConcreteM365CalendarFileTest.java:51
Code Initializing the Document:
"
System.setProperty(“java.awt.headless”, “true”);
// Load the html file to a pdf document
HtmlLoadOptions options = new HtmlLoadOptions();
Document pdfDocument = null;
try {
pdfDocument = new Document(htmlFilePath, options);
} catch (Throwable e) {
Logger.error(ConcreteM365CalendarFileTest.class, e);
throw new RuntimeException(e);
}
Logger.info(ConcreteM365CalendarFileTest.class, “Document loaded successfully – YYYY”);
"
Sample File:
body_content.zip (1.3 KB)