Highlighted

NoClassDefFoundError for javax.net.ssl.HostnameVerifier in case of third party jars which I am installing as bundle.

Avatar

Avatar

vikask7567025

Avatar

vikask7567025

vikask7567025

08-01-2020

Hi Experts,

 

I am trying to use one 3rd party jar (cloudinary) so that AEM can connect to cloudinary APIs, I have created bundle from these jars and installed in Felix console. Now when I am trying to invoke my logic to connect to cloudinary APIs, it is throwing  "java.lang.ClassNotFoundException: javax.net.ssl.HostnameVerifier not found" by jarBundle (3rd party jar bundle). while debugging I saw that this HostnameVerifier is available at rt.jar for 3rd party jar bundle still this issue is appearing.

 

Could someone help me here ?

 

Here is the exception stacktrace 

 

Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/HostnameVerifier
at org.apache.http.impl.client.HttpClients.custom(HttpClients.java:48)
at com.cloudinary.http44.UploaderStrategy.init(UploaderStrategy.java:40)
at com.cloudinary.Uploader.<init>(Uploader.java:43)
at com.cloudinary.Cloudinary.uploader(Cloudinary.java:43)
at com.abhi.www.cloudinary.impl.workflow.UpdateAssetWorkflowProcess.execute(UpdateAssetWorkflowProcess.java:51)
at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:93)
... 9 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.net.ssl.HostnameVerifier not found by cloudinaryBundle [570]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(Unknown Source)

 

This issue is happening only in AEM environment, if I am trying to connect that cloudinary apis in standalone Java Maven by using maven dependencies rather than plugin bundle creation (which I did in AEM), there is no such issue while invoking the api access logic.

 

Regards,

Vikas