在tomcat 8上/中运行的grails 3应用程序是否有操作说明?
背景:
| Grails版本:3.0.9
| Groovy版本:2.4.5
| JVM版本:1.8.0_91Grails application running at http://localhost:8080 in environment: productionINFO org.springframework.security.core.SpringSecurityCoreVersion - You are running with Spring Security Core 4.0.3.RELEA
我现在的当前步骤:
这能够运行该应用程序。我有能力
错误1:
``
错误org.apache.catalina.core.ContainerBase。[Tomcat]。[localhost]。[/]。[grailsDispatcherServlet]-的Servlet.service()
路径为[]的上下文中的servlet [grailsDispatcherServlet]引发了异常[无法解析名称为'/ index'的 View
名为“grailsDispatcherServlet”的servlet,其根本原因是
javax.servlet.ServletException:无法解析名称为“grailsDispatcherServlet”的servlet中名称为“/ index”的 View
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1227) ~[spring-webmvc-4.1.7.R
ELEASE.jar!/:4.1.7.RELEASE]
``
日志中的另一个错误是:
ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() forservlet grailsDispatcherServlet threw exceptionjavax.servlet.ServletException: Could not resolve view with name '/error' in servlet with name 'grailsDispatcherServlet'
我尝试在application.groovy中设置上下文:app.name=livecamgrails.app.context = "/livecam"
因此,静态安全设置为:
grails.plugin.springsecurity.controllerAnnotations.staticRules = [ [pattern: '/', access: ['permitAll']], [pattern: '/error', access: ['permitAll']], [pattern: '/index', access: ['permitAll']], [pattern: '/register', access: ['permitAll']], [pattern: '/failed', access: ['permitAll']], [pattern: '/index.gsp', access: ['permitAll']], [pattern: '/shutdown', access: ['permitAll']], [pattern: '/assets/**', access: ['permitAll']], [pattern: '/logout/**', access: ['permitAll']], [pattern: '/login/**', access: ['permitAll']], [pattern: '/**/js/**', access: ['permitAll']], [pattern: '/**/css/**', access: ['permitAll']], [pattern: '/**/images/**', access: ['permitAll']], [pattern: '/appstatus/**', access: ['permitAll']], [pattern: '/appStatus/**', access: ['permitAll']], [pattern: '/stats/**', access: ['permitAll']], [pattern: '/stat/**', access: ['permitAll']], [pattern: '/hello/**', access: ['permitAll']], [pattern: '/index/**', access: ['permitAll']], [pattern: '/testing/**', access: ['permitAll']], [pattern: '/j_spring_security_logout**', access:['permitAll']], [pattern: '/j_spring_security_facebook_redirect**', access: ['permitAll']], [pattern: '//j_spring_security_facebook_json**', access: ['permitAll']], [pattern: '/j_spring_security_facebook_redirect/**', access: ['permitAll']], [pattern: '//j_spring_security_facebook_check/**', access: ['permitAll']], [pattern: '/j_spring_security**', access: ['permitAll']], [pattern: '/**/*.htm*', access: ['permitAll']], [pattern: '/**/favicon.ico', access: ['permitAll']] ]
静态安全性是一个更新,我怀疑领先的/**/
需要存在! :(我们希望这是解决方案。 最佳答案
https://github.com/grails/grails-core/issues/9302
使搜索关键字正确是有益的。
graemerocher于2015年10月7日评论了
您可以通过执行cd build / libs然后执行java -jar app310-0.1.war来解决此问题。
Grails感到困惑,因为如果您从项目根目录运行它,则认为您正在本地运行该项目。
有效的关键字是:ServletException: Could not resolve view with name '/error' in servlet with name 'grailsDispatcherServlet'