Facing build issues after upgrading AEM SDK API to 2025.8 and JDK21 with test case build time | Community
Skip to main content
Level 2
August 29, 2025
Question

Facing build issues after upgrading AEM SDK API to 2025.8 and JDK21 with test case build time

  • August 29, 2025
  • 2 replies
  • 707 views

Facing below error while trying to upgrader to JDK21 with AEM SDK API 2025.8v, fallowed the steps updated the POM dependencies version to as per the guide, but while building the core with test case i am facing below error for 
Any help would be appreciated. 
java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.xssf.usermodel.XSSFWorkbook
at com.aem.bd.core.workflows.BDTagsReferenceWorkflow.execute(BDTagsReferenceWorkflow.java:28)
at com.aem.bd.core.workflows.BDTagsReferenceWorkflowTest.testBDTagsReferenceWorkflowTest(BDTagsReferenceWorkflowTest.java:87)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.status.StatusLogger$InstanceHolder [in thread "main"]
at org.apache.logging.log4j.status.StatusLogger.getLogger(StatusLogger.java:565)
at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:61)

 

 

2 replies

Adobe Champion
September 1, 2025

Based on recent pain, I suggest double-checking on the following:

 

  • Check your pom.xml to make sure correct Apache POI dependencies (org.apache.poi) declared
  • Run mvn dependency:tree to inspect your dependencies tree and identify any issues, especially around transitive dependencies.

 

Rather simple answer for now, but please do get back with your findings and we can take it from there.

Level 2
September 2, 2025

Thank you @user55521 

I have updated the POI dependency version to 5.2.3 from 4.0.0, and also trying by adding poi-ooxml-schemas, xmlbeans but still with and without these two getting the same error when test casese getting executed on below line of java code. 

try(XSSFWorkbook workbook = new XSSFWorkbook() ){

But when we build by skipping test case, build was fine and validated the functionality working in AEM instance as well.

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
<scope>test</scope>
</dependency>
<!--        <dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>5.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
<scope>test</scope>
</dependency>-->
Adobe Champion
September 2, 2025

Thank you for your reply @srikanth23696837zrx0 .

 

If skipping tests makes the build green, then the break is likely in your test toolchain/code. I’d treat BDTagsReferenceWorkflowTest as the culprit.

 

Try the following (if applicable and/or not done already). I suggest trying one by one and always try if the changed fixed something, avoid bulk-changing:

 

1. Upgrade the test runner & plugins, e.g. 

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.2.5</version> <configuration> <useModulePath>false</useModulePath> </configuration> </plugin>

 

2. Move the test to JUnit 5 + Mockito extension, e.g.

@ExtendWith({AemContextExtension.class, MockitoExtension.class}) class BDTagsReferenceWorkflowTest { private final AemContext context = new AemContext(); @Mock WorkflowSession workflowSession; @Mock WorkItem workItem; @Mock WorkflowData workflowData; // ... }

 

3. Ensure AEM/wcm.io test libs are current, e.g.

<dependency> <groupId>io.wcm</groupId> <artifactId>io.wcm.testing.aem-mock.junit5</artifactId> <version>5.6.10</version> <scope>test</scope> </dependency>

 

4. Avoid using Powermock

Powermock is problematic with later Java versions (see related article)

 

5. If the test still fails: isolate just this test class

mvn -Dtest=BDTagsReferenceWorkflowTest -X test

 

Let me know if any of the above helped!

kautuk_sahni
Community Manager
Community Manager
September 25, 2025

@srikanth23696837zrx0 Hi, any luck with this issue? If you figured it out, sharing your solution helps the community. And if a reply here helped—even a little—marking it as accepted makes it easier for others to find. Thanks for closing the loop!

Kautuk Sahni