应用布局时出错:main

时间:2016-03-07 11:08:23

标签: tomcat grails

我是grails的新手,我正在尝试将一个helloworld grails应用程序部署到tomcat。

我创建了war文件,然后将war文件放在tomcat的webapps目录下。然后我从bin文件夹启动了tomcat并跟踪了日志。部署的应用程序在日志中没有任何错误。

现在,当我尝试从浏览器访问应用程序时,我收到此错误

Error 500 - Internal Server Error.

Error applying layout : main

注意:当我执行grails run-app时,应用程序运行完美。

有人可以帮我解决与此有关的问题以及如何解决问题。

EDIT:
2016-03-07 16:34:27,260 [http-apr-8080-exec-5] ERROR StackTrace  - Full   Stack Trace:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error applying layout : main
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.rethrowRenderException(GroovyPageView.java:179)
at org.codehaus.groovy.grails.web.sitemesh.SpringMVCViewDecorator.render(SpringMVCViewDecorator.java:78)
at org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutView.renderTemplate(GrailsLayoutView.java:60)
at org.codehaus.groovy.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:49)
at org.codehaus.groovy.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:33)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)
at org.codehaus.groovy.grails.web.servlet.ErrorHandlingServlet.doDispatch(ErrorHandlingServlet.java:163)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:482)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:344)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:437)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: No signature of method: gsp_helloworld_layoutsmain_gsp.assetPath() is applicable for argument types: (java.util.LinkedHashMap) values: [[src:favicon.ico]]
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.createGroovyPageException(GroovyPageView.java:127)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:104)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderTemplate(GroovyPageView.java:75)
at org.codehaus.groovy.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:49)
at org.codehaus.groovy.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:33)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)
at org.codehaus.groovy.grails.web.sitemesh.SpringMVCViewDecorator.render(SpringMVCViewDecorator.java:69)
... 37 more

由于

1 个答案:

答案 0 :(得分:0)

问题与stacktrace行有关:No signature of method: gsp_helloworld_layoutsmain_gsp.assetPath() is applicable for argument types: (java.util.LinkedHashMap) values: [[src:favicon.ico]]

因此,在引用views/layouts/main.gsp期间,您在favicon.ico的布局视图中提供了错误类型的参数。