gpt4 book ai didi

Grails 渲染插件在部署时提供 java.lang.ClassNotFoundException

转载 作者:行者123 更新时间:2023-12-04 01:23:14 24 4
gpt4 key购买 nike

我关注了这个 tutorial成功并在本地主机上运行良好。这是关于使用使用 grails 渲染插件。它在 LOCALHOST 上运行良好,但当我部署应用程序时,甚至只是运行 grails run-war 时,渲染插件不再起作用。它给出了一些奇怪的错误。 :(

我将 grails 2.0.0 与渲染插件 0.4.3 一起使用,这就是我的 BuildConfig.groovy 包含的内容:

plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.5"
compile ":rendering:0.4.3"

build ":tomcat:$grailsVersion"
}

错误是这样的:
2012-09-27 17:08:47,714 [http-8643-1] ERROR errors.GrailsExceptionResolver  - ClassNotFoundException occurred when processing request: [GET] /profile/renderFormPDF/1
org.springframework.mock.web.MockHttpServletRequest. Stacktrace follows:
java.lang.ClassNotFoundException: org.springframework.mock.web.MockHttpServletRequest
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at grails.plugin.rendering.document.RenderEnvironment.init(RenderEnvironment.groovy:33)
at grails.plugin.rendering.document.RenderEnvironment.with(RenderEnvironment.groovy:69)
at grails.plugin.rendering.document.RenderEnvironment.with(RenderEnvironment.groovy:61)
at grails.plugin.rendering.document.XhtmlDocumentService.generateXhtml(XhtmlDocumentService.groovy:68)
at grails.plugin.rendering.document.XhtmlDocumentService.createDocument(XhtmlDocumentService.groovy:38)
at grails.plugin.rendering.RenderingService.render(RenderingService.groovy:34)
at grails.plugin.rendering.RenderingService.render(RenderingService.groovy:33)
at grails.plugin.rendering.RenderingService.render(RenderingService.groovy:63)
at com.icodeya.ProfileController.renderFormPDF(ProfileController.groovy:108)
at net.stax.appserver.webapp.RequestMonitorValve.invoke(RequestMonitorValve.java:35)
at net.stax.appserver.admin.StaxApplicationQueryValve.invoke(StaxApplicationQueryValve.java:49)
at net.stax.appserver.webapp.RequestSetupValve.invoke(RequestSetupValve.java:31)
at java.lang.Thread.run(Thread.java:662)

最佳答案

这是在开发环境中的 spring-test jar 中,但未包含在 WAR 文件中。添加

runtime 'org.springframework:spring-test:3.1.0.RELEASE'

dependencies BuildConfig.groovy 的部分。

关于Grails 渲染插件在部署时提供 java.lang.ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12627147/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com