java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.xssf.usermodel.XSSFWorkbook | Community
Skip to main content
Level 3
June 5, 2025

java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.xssf.usermodel.XSSFWorkbook

  • June 5, 2025
  • 2 replies
  • 546 views

Hi All,

 

With the new Cloud SDK apache POI JAR gets shipped along with SDK and while running my test case i am getting this error .

java.lang.NoClassDefFoundError Could not initialize class org.apache.poi.xssf.usermodel.XSSFWorkbook

 

Earlier i had imported the JAR from the dependency.How to fix these issues.

 

How we can fix this .Any inputs are highly appreciated.

 

Thanks

2 replies

SantoshSai
Community Advisor
Community Advisor
June 5, 2025

Hi @sb2512,

Can you check if it Align POI version with your AEM SDK?

AEM Cloud SDK includes a specific version of POI. To avoid conflicts:

  • Match the version in your pom.xml to what’s bundled in the SDK.

Check which POI version AEM SDK includes (you can check this via /system/console/depfinder or webconsole) — then, in your core module:

<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>4.1.2</version> <!-- Match this with the SDK --> <scope>provided</scope> <!-- IMPORTANT --> </dependency>

  • Use provided scope to avoid packaging it in the bundle.

Santosh Sai
Level 2
August 27, 2025

Hi @sb2512 

Did you get any resolution, i am also getting same sort error while test case build. I am using AEM SDK API 2025.8 and POI 5.2.5.
NoClassDefFound org/apache/poi/xddf/usermodel/chart/XDDFChart

 

Can you share anything

 

Thank;