Update Uber Jar with Service Pack SP20 | Adobe Higher Education
Skip to main content
Level 3
July 2, 2024
해결됨

Update Uber Jar with Service Pack SP20

  • July 2, 2024
  • 3 답변들
  • 2707 조회

We are experiencing runtime errors when importing Excel files in SP20, likely due to a different runtime version of the library. Can anyone provide input on the suitable version for SP20?

  1. Apache POI version
  2. Uber JAR version

Has anyone encountered a similar issue before?

error

java.lang.NoSuchMethodError: org.apache.poi.ss.usermodel.Cell.getCellTypeEnum()Lorg/apache/poi/ss/usermodel/CellType;

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


Thanks,
Sai

 

이 주제는 답변이 닫혔습니다.
최고의 답변: Raja_Reddy

Hi @sai1278 
You can use below code. hope it's work

private static String cellToString(Cell pCell) { String retval = null; if (pCell != null) { switch (pCell.getCellType()) { case BOOLEAN: retval = String.valueOf(pCell.getBooleanCellValue()); break; case NUMERIC: if (DateUtil.isCellDateFormatted(pCell)) { retval = String.valueOf(pCell.getDateCellValue()); } else { retval = String.valueOf(pCell.getNumericCellValue()); } break; case STRING: retval = pCell.getStringCellValue(); break; case FORMULA: switch (pCell.getCachedFormulaResultType()) { case NUMERIC: retval = String.valueOf(pCell.getNumericCellValue()); break; case STRING: retval = pCell.getRichStringCellValue().getString(); break; default: break; } break; default: break; } } return retval; }

 

3 답변

h_kataria
Community Advisor
Community Advisor
July 2, 2024

A. if you are using 6.5.20 then you should use the same Uber jar version in your pom as well

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

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/release-notes/service-pack/6-5-20#uber-jar
B. you can try to get the exact apache poi version from the dependency finder /system/console/depfinder . Just provide the package name that you are trying to use and you will get the bundle exporting it and the dependency which you can use in your pom. Below reference is from cloud SDK but probably it will be same for 6.5.20. You can cross check and use that on your instance and use that

<dependency> <artifactId>com.adobe.granite.poi</artifactId> <version>2.1.0</version> <groupId>com.adobe.granite</groupId> <scope>provided</scope> </dependency>





Sai1278작성자
Level 3
July 2, 2024

Hi @h_kataria 
Thanks for the reply. I have already tried the solutions mentioned, but the issue has not been resolved. Could you please provide some more context?

Lokesh_Vajrala
Community Advisor
Community Advisor
July 2, 2024

@sai1278  What version of org.apache.poi is exported through the bundle com.adobe.granite.poi ?  You can try using the version exported from the granite.poi bundle and check if the error is gone. 

MukeshYadav_
Community Advisor
Community Advisor
July 3, 2024
Sai1278작성자
Level 3
July 3, 2024

Hi @mukeshyadav_ 
I follow the which you mention steps but the issue is not resolved

Raja_Reddy
Community Advisor
Community Advisor
July 5, 2024

Hi @sai1278 
are you following @h_kataria  mention steps? 
still you are facing issue. please try below version uber and poi versions

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.5.20</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>5.2.5</version> </dependency>

  

Sai1278작성자
Level 3
July 5, 2024

Hi @raja_reddy 

I have used the which you mention version above, but the issue remains unresolved and errors are not being printed in the log files. If possible, could you please provide changes to the getCellType method?

 

Raja_Reddy
Community Advisor
Community Advisor
July 5, 2024

Hi @sai1278 
You can use below code. hope it's work

private static String cellToString(Cell pCell) { String retval = null; if (pCell != null) { switch (pCell.getCellType()) { case BOOLEAN: retval = String.valueOf(pCell.getBooleanCellValue()); break; case NUMERIC: if (DateUtil.isCellDateFormatted(pCell)) { retval = String.valueOf(pCell.getDateCellValue()); } else { retval = String.valueOf(pCell.getNumericCellValue()); } break; case STRING: retval = pCell.getStringCellValue(); break; case FORMULA: switch (pCell.getCachedFormulaResultType()) { case NUMERIC: retval = String.valueOf(pCell.getNumericCellValue()); break; case STRING: retval = pCell.getRichStringCellValue().getString(); break; default: break; } break; default: break; } } return retval; }