2016-03-07 60 views
1

我是新來的grails,並且正在嘗試將一個helloworld grails應用程序部署到tomcat。應用佈局時出錯:主要

我創建了war文件,然後將war文件放在tomcat的webapps目錄下。然後,我從bin文件夾啓動了tomcat並跟蹤了日誌。該應用程序在日誌中沒有任何錯誤地部署。

現在,當我嘗試從瀏覽器中我得到這個錯誤

Error 500 - Internal Server Error. 

Error applying layout : main 

注意訪問應用程序:當我做一個Grails運行的應用程序,該應用程序完美運行。

有人可以幫我解決這個問題,以及我如何解決這個問題。

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 

由於

+0

你可以附加錯誤的完整stacktrace? – droggo

+0

這就是我在瀏覽器中得到的...並且在tomcat日誌中沒有錯誤。 –

+0

您使用的是Tomcat,JDK,OS和Grails版本? – droggo

回答

0

問題是與堆棧跟蹤線路連接:No signature of method: gsp_helloworld_layoutsmain_gsp.assetPath() is applicable for argument types: (java.util.LinkedHashMap) values: [[src:favicon.ico]]

因此,在參考favicon.ico期間,您在版面視圖views/layouts/main.gsp中提供了錯誤類型的參數。