cannot access org.apache.poi.ooxml.POIXMLDocument with latest uber version 6.5.15 | Community
Skip to main content
Mario248
Level 7
April 27, 2023

cannot access org.apache.poi.ooxml.POIXMLDocument with latest uber version 6.5.15

  • April 27, 2023
  • 3 replies
  • 6985 views

I am facing compilation error after upgrading uber jar version from 6.5.0 to 6.5.15.

 

Updated Uber jar

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.5.15</version> <scope>provided</scope> </dependency>

 

After updated uber I tried to compile the code but ended up with below error, 

 

[ERROR] COMPILATION ERROR :

[INFO] -------------------------------------------------------------

[ERROR] ImageRender.java:[326,42] cannot access org.apache.poi.ooxml.POIXMLDocument

  class file for org.apache.poi.ooxml.POIXMLDocument not found

 

I thought the latest version removed this org.apache.poi.ooxml.POIXMLDocument so I manually added below dependency to resolve the issue 

 

 

 

<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.17</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>5.2.2</version> </dependency>

 

 
But even after above dependency I get the same compile time error. Is there any problem with org.apache.poi.ooxml.POIXMLDocument in latest uber version (6.5.15)
 
Is anyone facing this similar issue ?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

AsifChowdhury
Community Advisor
Community Advisor
April 27, 2023

Hello @mario248 ,

Try with the same version of both dependency

<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>5.2.2</version> </dependency>

A similar thing is discussed here.

https://stackoverflow.com/questions/63384557/issue-with-apache-poi-upgrading-aem-from-6-5-2-6-5-5

 

Vinayak_M
May 14, 2024

Use below code instead of Workbook workbook = new XSSFWorkbook() it will resolve your issue.

 

Workbook workbook = new HSSFWorkbook();

 

Mario248
Mario248Author
Level 7
April 27, 2023

Sorry, I forgot to mention I have included both artifactId poi & poi-ooxml but still I am getting the same error. I have included below dependencies in parent pom.xml 

 

<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>5.2.3</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>5.2.2</version> </dependency>

 Added below dependencies in core module's pom.xml 

 

<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> </dependency>

 

Mario248
Mario248Author
Level 7
April 27, 2023

Thank you so much for your input. It resolved compilation issue but I am facing issue in junit - Unexpected exception thrown: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.xssf.usermodel.XSSFWorkbookType

 

When I checked the java class I found that XSSFWorkbook is having problem. I see below code

 

Workbook workbook = new org.apache.poi.xssf.usermodel.XSSFWorkbook();

 

Any idea why idea why junit class is unable to initialize class org.apache.poi.xssf.usermodel.XSSFWorkbookType?

August 23, 2023

Hi @mario248, did you resolve this issue?