0

I created the war file and deployed into tomcat server but while submitting the registration page(having recaptcha) this error is happening, but not in the local machine and app running in the local machine using the GGTS IDE.

Following is the error happening in the production server

    errors.GrailsExceptionResolver  - ClassNotFoundException occurred when processing request: [POST] /IFP/signup/completeSignUp
grails.plugins.rest.client.RestBuilder. Stacktrace follows:
java.lang.ClassNotFoundException: grails.plugins.rest.client.RestBuilder
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
    at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
    at com.megatome.grails.recaptcha.ReCaptcha.checkAnswer(ReCaptcha.groovy:171)
    at com.megatome.grails.RecaptchaService.verifyAnswer(RecaptchaService.groovy:147)
    at com.controllers.portal.SignupController.completeSignUp(SignupController.groovy:42)
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:53)
    at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

From my view this exception is happening after the implementation of recaptcha. Please help me for resolving this issue.

Ragesh ck
  • 31
  • 8

3 Answers3

1

java.lang.ClassNotFoundException: grails.plugins.rest.client.RestBuilder

states clearly that this class is missing in your production war or Tomcat.

Make sure you are setting proper dependencies in your gradle config as per plugin ref-doc:

compile "org.grails.plugins:rest-client-builder:2.1.1"

Check that those jars are also present in your war or Tomcat's classpath

injecteer
  • 20,038
  • 4
  • 45
  • 89
  • Got it, it is happened because the recaptcha using the **RestBuilder** class and that is invoked from the `grails-datastore-rest-client-3.1.4.RELEASE.jar`.Now its is working after copying this jar file into the tomcat lib folder. – Ragesh ck Apr 11 '17 at 09:44
  • with `gradle` copying the files is the last thing on the planet you want to do – injecteer Apr 10 '18 at 08:00
0

Copying the file grails-datastore-rest-client-3.1.4.RELEASE.jar into the tomcat lib folder resolved the problem. You can download the jar file from here.

Ragesh ck
  • 31
  • 8
0

If someone is still looking for the answer: Please add the line below to build.gradle and it should work (pulls in a necessary dependency):

implementation 'org.grails:grails-datastore-rest-client:6.1.9.RELEASE'
ahuemmer
  • 1,653
  • 9
  • 22
  • 29
joy2014
  • 1
  • 1
  • 2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32629450) – mymiracl Sep 07 '22 at 10:50
  • @mymiracl, the link does not lead to the solution, it's just kind of a remark that gets copy-pasted when you use mvnrepository.com. I'll suggest an edit to get it removed. :) – ahuemmer Sep 08 '22 at 05:33