Expand my Community achievements bar.

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

Avatar

Level 4

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

1 Reply

Avatar

Community Advisor

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

AEM BlogsLinkedIn