Getting NoClassDefFoundError exception for com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient
Hello everyone,
We are integrating Google reCaptcha enterprise version with AEM cloud. We are able to load reCaptcha challenge on custom form but while generating assessment score(through java code) we are getting NoClassDefFoundError exception.
We have imported below in core pom.xml:
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<id>bnd-process</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd><![CDATA[
Import-Package: javax.annotation;version=0.0.0,com.google.*;version=0.0.0;resolution:=optional,*
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>
maven build is getting successful and bundle is also active. But its giving error for below line in java class:
RecaptchaEnterpriseServiceClient client = RecaptchaEnterpriseServiceClient.create()
RecaptchaEnterpriseServiceClient client = RecaptchaEnterpriseServiceClient.create()

Error:
com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient
Cannot serve request to /content/my-program/home/members.recaptcha-response in com.my.program.core.servlets.GetRecaptchaResponseServlet
Exception:
java.lang.NoClassDefFoundError: com/google/cloud/recaptchaenterprise/v1/RecaptchaEnterpriseServiceClient at com.my.program.core.services.RecaptchaService.getResponse(RecaptchaService.java:61) at com.my.program.core.servlets.GetRecaptchaResponseServlet.doPost(GetRecaptchaResponseServlet.java:44)
Can anyone please help here?