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>
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
Use below code instead of Workbook workbook = new XSSFWorkbook() it will resolve your issue.
Workbook workbook = new HSSFWorkbook();
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>
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?
Hi @Mario248, did you resolve this issue?
Views
Replies
Total Likes
Was the JUNIT issue solved?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies