Is there a how-to explained for grails 3 app run on/in tomcat 8?
Background:
| Grails Version: 3.0.9
| Groovy Version: 2.4.5
| JVM Version: 1.8.0_91
Grails application running at http://localhost:8080 in environment: production
INFO org.springframework.security.core.SpringSecurityCoreVersion - You are running with Spring Security Core 4.0.3.RELEA
Current steps I'm at now:
- grails compile
- grails prod war
- java -Dgrails.env=prod -jar build/libs/gr-base-0.21.war
This is able to run the app. I'm able
- able to see html directory http://localhost:8080/privacy.html
- redirection to default spring login page (accepts u/p)
- Unsecured json service webapi works fine!
ERROR 1: ```` ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'] with root cause javax.servlet.ServletException: Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1227) ~[spring-webmvc-4.1.7.R
ELEASE.jar!/:4.1.7.RELEASE]
````
Another error in logs is:
ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() for
servlet grailsDispatcherServlet threw exception
javax.servlet.ServletException: Could not resolve view with name '/error' in servlet with name 'grailsDispatcherServlet'
I tried setting the context in application.groovy:
app.name=livecam
grails.app.context = "/livecam"
The static security settings are thus:
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']]
]
The static security was an update, I suspect the leading /**/ needs to be there! :( Let's hope this is the solution.