Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

AEM 6.5 On Prem : ClassNotFound Error

Avatar

Level 3

Hi All - So i ran into weird issue today. We have an external saas provider jar file for which we created a bundle and installed it on our AEM server. We included this external saas provider jar file as dependency in our pom.xml and the code builds perfectly fine and our application jar file is deployed without any issues on server. When we execute our code on server, we were getting ClassNotFoundError for okhttp3/RequestBody which is expected by saas provider class. So we proceeded to create another bundle for okhttp3 and installed it on server. We checked OSGI Package dependency to ensure that required class which gave error before is found on the server. Even after creating and deploying okhttp3 bundle we are still getting same error when we execute our code.

We tried one more approach to fix this issue, which was to add Import-Package in 3rd party saas jar to explicitly mention okhttp3 dependency but still could not resolve the issue.

Here is rough diagram of dependency and issue which is occurring:

 

class.drawio.png

 Any help/ pointers in resolving the issue will be highly appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 3

This issue can be marked fixed. Issue was that external saas dependency bundle was some how being referenced in my project bundle was an old one which resulted in the issue. I refreshed my project bundle to resolve this issue.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

This issue can be marked fixed. Issue was that external saas dependency bundle was some how being referenced in my project bundle was an old one which resulted in the issue. I refreshed my project bundle to resolve this issue.