我创建了war文件并将其部署到tomcat服务器中,但在提交注册页面(具有recaptcha)时发生了此错误,但不是在本地计算机中,也不是在使用GGTS IDE的本地计算机中运行的应用程序中。
以下是生产服务器中发生的错误
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)
在我看来,这个异常是在执行了captcha之后发生的。请帮助我解决这个问题。
3条答案
按热度按时间1szpjjfi1#
java.lang.ClassNotFoundException:grails.plugins.rest.client.RestBuilder
清楚地表明在您的生产war或Tomcat中缺少此类。
请确保在
gradle
配置中按照plugin ref-doc设置了正确的依赖关系:检查这些jar是否也存在于war或Tomcat的类路径中
ljsrvy3e2#
将
grails-datastore-rest-client-3.1.4.RELEASE.jar
文件复制到tomcat lib文件夹解决了这个问题。您可以从here下载jar文件。nfs0ujit3#
如果有人还在寻找答案:请将下面的行添加到
build.gradle
中,它应该可以工作(拉入必要的依赖项):