Grails exception handling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails exception handling

Fedor Belov
Hello. My UrlMappings.groovy contains `"500"(controller: 'error', action: '500')`. Action `500` points to `/system/error` view.

Sometimes Grails prints followings exception (when other exception occurs - like java.lang.NullPointerException: Cannot invoke method multiply() on null object): ServletException occurred when processing request: [POST] /sites:8vhapte2/where:all/page:2437 File "/WEB-INF/grails-app/views/error.jsp" not found.

Can you explain why Grails tries to load /views/error.jsp file?

ps
I can't reproduce this error on dev environment - it correctly executes action `500` on any exception

Here is full stacktrace:

[WARN]  [g.p.c.w.f.e.EhcachePageFragmentCachingFilter]: Throwable thrown during doFilter on request with URI: /grails/movie/index.dispatch and Query: null : File "/WEB-INF/grails-app/views/error.jsp" not found
javax.servlet.ServletException: File "/WEB-INF/grails-app/views/error.jsp" not found
        at org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:412) ~[jasper.jar:7.0.42]
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) ~[jasper.jar:7.0.42]
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) ~[jasper.jar:7.0.42]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) ~[servlet-api.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544) [catalina.jar:7.0.42]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_11]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_11]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_11]
        at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11]
        at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:117) [javamelody-core-1.37.0.jar:1.37.0]
        at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:231) [javamelody-core-1.37.0.jar:1.37.0]
        at $Proxy30.include(Unknown Source) [na:na]
        at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:229) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:400) ~[grails-web-2.2.4.jar:2.2.4]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) ~[servlet-api.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) ~[servlet-api.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200) ~[PageFragmentCachingFilter.class:na]
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) ~[AbstractFilter.class:na]
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339) [catalina.jar:7.0.42]
        at sun.reflect.GeneratedMethodAccessor563.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_11]
        at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11]
        at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:117) [javamelody-core-1.37.0.jar:1.37.0]
        at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:231) [javamelody-core-1.37.0.jar:1.37.0]
        at $Proxy30.forward(Unknown Source) [na:na]
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:314) [grails-web-2.2.4.jar:2.2.4]
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:279) [grails-web-2.2.4.jar:2.2.4]
        at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:270) [grails-web-2.2.4.jar:2.2.4]
        at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:222) [grails-plugin-url-mappings-2.2.4.jar:2.2.4]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:206) [grails-web-2.2.4.jar:2.2.4]
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:152) [grails-web-2.2.4.jar:2.2.4]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.42]
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:197) [javamelody-core-1.37.0.jar:1.37.0]
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:171) [javamelody-core-1.37.0.jar:1.37.0]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) [catalina.jar:7.0.42]
Reply | Threaded
Open this post in threaded view
|

Re: Grails exception handling

wilsonaikeda@gmail.com
Maybe your dev machine ignores the single quotes whereas your prod not? But why you are declaring the mapping inside single quotes?

> "/WEB-INF/grails-app/views/error.jsp&quot



On Sep 24, 2013, at 11:30 PM, Fedor Belov <[hidden email]> wrote:

> Hello. My UrlMappings.groovy contains `"500"(controller: 'error', action:
> '500')`. Action `500` points to `/system/error` view.
>
> Sometimes Grails prints followings exception (when other exception occurs -
> like java.lang.NullPointerException: Cannot invoke method multiply() on null
> object): ServletException occurred when processing request: [POST]
> /sites:8vhapte2/where:all/page:2437 File
> "/WEB-INF/grails-app/views/error.jsp" not found.
>
> Can you explain why Grails tries to load /views/error.jsp file?
>
> ps
> I can't reproduce this error on dev environment - it correctly executes
> action `500` on any exception
>
> Here is full stacktrace:
>
> [WARN]  [g.p.c.w.f.e.EhcachePageFragmentCachingFilter]: Throwable thrown
> during doFilter on request with URI: /grails/movie/index.dispatch and Query:
> null : File &quot;/WEB-INF/grails-app/views/error.jsp&quot; not found
> javax.servlet.ServletException: File
> &quot;/WEB-INF/grails-app/views/error.jsp&quot; not found
> at
> org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:412)
> ~[jasper.jar:7.0.42]
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
> ~[jasper.jar:7.0.42]
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
> ~[jasper.jar:7.0.42]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> ~[servlet-api.jar:na]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
> [catalina.jar:7.0.42]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.7.0_11]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> ~[na:1.7.0_11]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_11]
> at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11]
> at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:117)
> [javamelody-core-1.37.0.jar:1.37.0]
> at
> net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:231)
> [javamelody-core-1.37.0.jar:1.37.0]
> at $Proxy30.include(Unknown Source) [na:na]
> at
> org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:229)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:400)
> ~[grails-web-2.2.4.jar:2.2.4]
> at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
> ~[servlet-api.jar:na]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> ~[servlet-api.jar:na]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)
> ~[PageFragmentCachingFilter.class:na]
> at
> grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
> ~[AbstractFilter.class:na]
> at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
> [catalina.jar:7.0.42]
> at sun.reflect.GeneratedMethodAccessor563.invoke(Unknown Source) ~[na:na]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_11]
> at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11]
> at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:117)
> [javamelody-core-1.37.0.jar:1.37.0]
> at
> net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:231)
> [javamelody-core-1.37.0.jar:1.37.0]
> at $Proxy30.forward(Unknown Source) [na:na]
> at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:314)
> [grails-web-2.2.4.jar:2.2.4]
> at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:279)
> [grails-web-2.2.4.jar:2.2.4]
> at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:270)
> [grails-web-2.2.4.jar:2.2.4]
> at
> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:222)
> [grails-plugin-url-mappings-2.2.4.jar:2.2.4]
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:206)
> [grails-web-2.2.4.jar:2.2.4]
> at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:152)
> [grails-web-2.2.4.jar:2.2.4]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:197)
> [javamelody-core-1.37.0.jar:1.37.0]
> at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:171)
> [javamelody-core-1.37.0.jar:1.37.0]
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Grails-exception-handling-tp4649512.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Grails exception handling

Antony Jones
Might be unrelated but I don't think '500' is a good action name, actions are methods and should therefore start with an alpha character.

If your gsp or action causes an error, it will try to load another error page.

If your action is called 'error' in the 'system' controller, put your gsp in views/system/error.gsp and leave the action body blank - don't include any content in the gsp other than 'hello' or similar, and go from there.


On 24 September 2013 17:27, [hidden email] <[hidden email]> wrote:
Maybe your dev machine ignores the single quotes whereas your prod not? But why you are declaring the mapping inside single quotes?

> &quot;/WEB-INF/grails-app/views/error.jsp&quot



On Sep 24, 2013, at 11:30 PM, Fedor Belov <[hidden email]> wrote:

> Hello. My UrlMappings.groovy contains `"500"(controller: 'error', action:
> '500')`. Action `500` points to `/system/error` view.
>
> Sometimes Grails prints followings exception (when other exception occurs -
> like java.lang.NullPointerException: Cannot invoke method multiply() on null
> object): ServletException occurred when processing request: [POST]
> /sites:8vhapte2/where:all/page:2437 File
> "/WEB-INF/grails-app/views/error.jsp" not found.
>
> Can you explain why Grails tries to load /views/error.jsp file?
>
> ps
> I can't reproduce this error on dev environment - it correctly executes
> action `500` on any exception
>
> Here is full stacktrace:
>
> [WARN]  [g.p.c.w.f.e.EhcachePageFragmentCachingFilter]: Throwable thrown
> during doFilter on request with URI: /grails/movie/index.dispatch and Query:
> null : File &quot;/WEB-INF/grails-app/views/error.jsp&quot; not found
> javax.servlet.ServletException: File
> &quot;/WEB-INF/grails-app/views/error.jsp&quot; not found
>       at
> org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:412)
> ~[jasper.jar:7.0.42]
>       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
> ~[jasper.jar:7.0.42]
>       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
> ~[jasper.jar:7.0.42]
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> ~[servlet-api.jar:na]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
> [catalina.jar:7.0.42]
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.7.0_11]
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> ~[na:1.7.0_11]
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_11]
>       at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11]
>       at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:117)
> [javamelody-core-1.37.0.jar:1.37.0]
>       at
> net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:231)
> [javamelody-core-1.37.0.jar:1.37.0]
>       at $Proxy30.include(Unknown Source) [na:na]
>       at
> org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:229)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.doDispatch(GrailsDispatcherServlet.java:400)
> ~[grails-web-2.2.4.jar:2.2.4]
>       at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
> ~[spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
> ~[servlet-api.jar:na]
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
> ~[servlet-api.jar:na]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:200)
> ~[PageFragmentCachingFilter.class:na]
>       at
> grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
> ~[AbstractFilter.class:na]
>       at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
> [catalina.jar:7.0.42]
>       at sun.reflect.GeneratedMethodAccessor563.invoke(Unknown Source) ~[na:na]
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[na:1.7.0_11]
>       at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_11]
>       at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:117)
> [javamelody-core-1.37.0.jar:1.37.0]
>       at
> net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:231)
> [javamelody-core-1.37.0.jar:1.37.0]
>       at $Proxy30.forward(Unknown Source) [na:na]
>       at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:314)
> [grails-web-2.2.4.jar:2.2.4]
>       at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:279)
> [grails-web-2.2.4.jar:2.2.4]
>       at
> org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:270)
> [grails-web-2.2.4.jar:2.2.4]
>       at
> org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:222)
> [grails-plugin-url-mappings-2.2.4.jar:2.2.4]
>       at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:206)
> [grails-web-2.2.4.jar:2.2.4]
>       at
> org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:152)
> [grails-web-2.2.4.jar:2.2.4]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> [catalina.jar:7.0.42]
>       at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:197)
> [javamelody-core-1.37.0.jar:1.37.0]
>       at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:171)
> [javamelody-core-1.37.0.jar:1.37.0]
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> [catalina.jar:7.0.42]
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Grails-exception-handling-tp4649512.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
________________________________
ꜽ . antony jones . http://www.enzy.org
Reply | Threaded
Open this post in threaded view
|

Re: Grails exception handling

Fedor Belov
Our error page is static - it's processed by nginx. But I'll check it again

Can you explain me why grails tries to load error.jsp (not .gsp)?


25.09.2013 20:27, Antony Jones [via Grails] пишет:
Might be unrelated but I don't think '500' is a good action name, actions are methods and should therefore start with an alpha character.

If your gsp or action causes an error, it will try to load another error page.

If your action is called 'error' in the 'system' controller, put your gsp in views/system/error.gsp and leave the action body blank - don't include any content in the gsp other than 'hello' or similar, and go from there.
 
________________________________
ꜽ . antony jones . http://www.enzy.org



If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Grails-exception-handling-tp4649512p4649583.html
To unsubscribe from Grails exception handling, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Grails exception handling

Lari Hotari -
Our error page is static - it's processed by nginx. But I'll check it again

Can you explain me why grails tries to load error.jsp (not .gsp)?


25.09.2013 20:27, Antony Jones [via Grails] пишет:
Might be unrelated but I don't think '500' is a good action name, actions are methods and should therefore start with an alpha character.

If your gsp or action causes an error, it will try to load another error page.

If your action is called 'error' in the 'system' controller, put your gsp in views/system/error.gsp and leave the action body blank - don't include any content in the gsp other than 'hello' or similar, and go from there.
 
________________________________
ꜽ . antony jones . http://www.enzy.org



If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Grails-exception-handling-tp4649512p4649583.html
To unsubscribe from Grails exception handling, click here.
NAML



View this message in context: Re: Grails exception handling
Sent from the Grails - user mailing list archive at Nabble.com.