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”);
"
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFJAVA-44627
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
We cannot really say that these are similar issues because both tickets have not been investigated yet. The ticket attached in this forum thread is related to GitHub Actions. Nevertheless, we will update here as soon as some progress is made towards ticket resolution. Please spare us some time.
Regretfully, no progress has been made yet due to other ticket logged prior to this issue. Nevertheless, we will surely let you know as soon as we make some progress in this regard. Please spare us some time.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.