Uploaded image for project: 'Grails'
  1. Grails
  2. GRAILS-4387

StackOverflowError when using controllerName in a filter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.3.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      This has been reproduced in Tomcat 6.x

      Description

      Sometimes, and with no apparent reason, I get a infinite loop of StackOverflowError's, resulting on gigas of logfiles .

      The application is a production one, usually stable, using Grails 1.1. The error is:

       
      GRAVE: El Servlet.service() para servlet grails lanzó una excepción
      java.lang.StackOverflowError
             at org.apache.catalina.connector.RequestFacade.getAttribute(RequestFacade.java:263)
             at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:222)
             at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:222)
             at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:222)
             [... tons of this one ...]
             at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:222)
             at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:222)
              at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:222)
              at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest.getControllerName(GrailsWebRequest.java:184)
              at sun.reflect.GeneratedMethodAccessor2855.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
              at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
              at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1584)
              at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:938)
              at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3275)
              at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:951)
              at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:158)
              at org.codehaus.groovy.runtime.callsite.PojoMetaClassGetPropertySite.callGetProperty(PojoMetaClassGetPropertySite.java:41)
              at org.codehaus.groovy.grails.web.plugins.support.WebMetaUtils$_registerCommonWebProperties_closure10.doCall(WebMetaUtils.groovy:87)
              at sun.reflect.GeneratedMethodAccessor657.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
              at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:81)
              at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
              at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1584)
              at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:938)
              at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3275)
              at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:951)
              at org.codehaus.groovy.grails.plugins.web.filters.FilterConfig.getProperty(FilterConfig.groovy)
              at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:153)
              at groovy.lang.Closure.getPropertyTryThese(Closure.java:187)
              at groovy.lang.Closure.getPropertyDelegateFirst(Closure.java:180)
              at groovy.lang.Closure.getProperty(Closure.java:165)
              at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:153)
              at groovy.lang.Closure.getPropertyTryThese(Closure.java:187)
              at groovy.lang.Closure.getPropertyOwnerFirst(Closure.java:203)
              at groovy.lang.Closure.getProperty(Closure.java:173)
              at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:240)
              at SecurityFilters$_closure1_closure2_closure6.doCall(SecurityFilters.groovy:12)
              [... thousand lines to follow ...]
      

      Our affected class is:

               at SecurityFilters$_closure1_closure2_closure6.doCall(SecurityFilters.groovy:12)

      SecurityFilters.groovy:12 is

                      if (controllerName != 'auth') {
      

      The last class in the stack just before the loop is:

               org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest.getControllerName(GrailsWebRequest.java:184)

        Activity

        Hide
        Peter Ledbrook added a comment -

        I believe this has been fixed. I haven't seen the error on grails.org for a long time.

        Show
        Peter Ledbrook added a comment - I believe this has been fixed. I haven't seen the error on grails.org for a long time.
        Hide
        Tony Copping added a comment -

        Funny... I'm seeing this in a production application running grails 1.3.6.
        So there was a specific fix done in 1.3.7, or was it marked as fixed because nobody has seen it in a while?

        Show
        Tony Copping added a comment - Funny... I'm seeing this in a production application running grails 1.3.6. So there was a specific fix done in 1.3.7, or was it marked as fixed because nobody has seen it in a while?
        Hide
        Alvaro Sanchez-Mariscal added a comment -

        I originally experienced it, but it was 2,5 years ago. With newer versions of Grails, the error dissapeared.

        Show
        Alvaro Sanchez-Mariscal added a comment - I originally experienced it, but it was 2,5 years ago. With newer versions of Grails, the error dissapeared.
        Hide
        Maximillian Bolotin added a comment -

        I just had this error and my log file got up to 4GB running 2.3.5 and Tomcat 7.0.30. The first exception in the file was:

        2014-07-19 10:30:37,357 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make
        No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure). Stacktrace follows:
        groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure)
        at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13)

        This started a recurring error with the stack trace getting longer each time:

        2014-07-19 10:30:37,419 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make
        No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure). Stacktrace follows:
        groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure)
        at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13)
        2014-07-19 10:30:37,432 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make
        No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure). Stacktrace follows:
        groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure)
        at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13)
        2014-07-19 10:30:37,441 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make
        No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure). Stacktrace follows:
        groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login]
        Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object, split(groovy.lang.Closure)
        at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
        at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
        at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13)

        I should be able to fix whatever issue we have with a bad use of a plus sign in our config, but I thought I should at least post that this was still an issue here. The non-authentication filter is a very simple filter we use for spring security pages that do not require authentication and basically does nothing. Though the page mentions definitely should be authenticated.

        Show
        Maximillian Bolotin added a comment - I just had this error and my log file got up to 4GB running 2.3.5 and Tomcat 7.0.30. The first exception in the file was: 2014-07-19 10:30:37,357 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure) at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13) This started a recurring error with the stack trace getting longer each time: 2014-07-19 10:30:37,419 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure) at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13) 2014-07-19 10:30:37,432 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure) at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13) 2014-07-19 10:30:37,441 [http-bio-8080-exec-110] ERROR errors.GrailsExceptionResolver - MissingMethodException occurred when processing request: [GET] /gguweb/appointment/make No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure). Stacktrace follows: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String) values: [/login] Possible solutions: plus(java.util.Collection), plus(java.util.Map), values(), put(java.lang.Object, java.lang.Object), use([Ljava.lang.Object , split(groovy.lang.Closure) at AuthorizationFilters$_closure1_closure2_closure9.doCall(AuthorizationFilters.groovy:17) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at edu.ggu.security.NonAuthenticationFilter.doFilter(NonAuthenticationFilter.groovy:13) I should be able to fix whatever issue we have with a bad use of a plus sign in our config, but I thought I should at least post that this was still an issue here. The non-authentication filter is a very simple filter we use for spring security pages that do not require authentication and basically does nothing. Though the page mentions definitely should be authenticated.
        Hide
        Maximillian Bolotin added a comment -

        The issue is related to an error in a filter. With a simple filter like this:

        def filters = {
        redirectAppt(uri: '/test/**') {
        before =

        { redirect(url: grailsApplication.config.grails.webHome + '/login') }

        }
        }

        try any http://localhost:8080/appname/test/gibberish in a browser. This will generate an endless loop and blow up your log file.

        Show
        Maximillian Bolotin added a comment - The issue is related to an error in a filter. With a simple filter like this: def filters = { redirectAppt(uri: '/test/**') { before = { redirect(url: grailsApplication.config.grails.webHome + '/login') } } } try any http://localhost:8080/appname/test/gibberish in a browser. This will generate an endless loop and blow up your log file.

          People

          • Assignee:
            Peter Ledbrook
            Reporter:
            Alvaro Sanchez-Mariscal
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: