Quantcast

StackOverflowError in GrailsWebRequest.getControllerName

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

StackOverflowError in GrailsWebRequest.getControllerName

Alvaro Sanchez-Mariscal
Hi,

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 ...]

In bold there is my class involved in this trace, a filter. Line 12 is:

                if (controllerName != 'auth') {

This usually works, but sometimes I get this error.

What may be happening?

Thanks in advance.

Alvaro.

--
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect & Instructor
[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: StackOverflowError in GrailsWebRequest.getControllerName

arecibo
I am getting the same StackOverflowError. In my case, it happens when I call request.forwardURI in my SSL redirect filter. It's similar to OP's situation where the error occurs in a filter. I am using Grails 1.3.7. Below is part of my stack trace:

at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:229)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:229)
    at org.apache.catalina.core.ApplicationHttpRequest.getAttribute(ApplicationHttpRequest.java:229)
    at javax.servlet.ServletRequestWrapper.getAttribute(ServletRequestWrapper.java:82)
    at org.codehaus.groovy.grails.web.util.WebUtils.getForwardURI(WebUtils.java:534)
    at org.codehaus.groovy.grails.web.util.WebUtils$getForwardURI.call(Unknown Source)
    at org.codehaus.groovy.grails.plugins.web.ServletsGrailsPlugin$_closure1_closure6.doCall(ServletsGrailsPlugin.groovy:80)
    at sun.reflect.GeneratedMethodAccessor1255.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:90)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
    at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:57)
    at groovy.lang.MetaBeanProperty$getProperty.call(Unknown Source)
    at org.codehaus.groovy.grails.plugins.web.ServletsGrailsPlugin$_closure1_closure2.doCall(ServletsGrailsPlugin.groovy:44)
    at sun.reflect.GeneratedMethodAccessor275.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:90)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
    at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1109)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:161)
    at org.codehaus.groovy.runtime.callsite.PojoMetaClassGetPropertySite.callGetProperty(PojoMetaClassGetPropertySite.java:41)
    at SSLFilters.getRedirectURL(SSLFilters.groovy:62)
    at SSLFilters.this$2$getRedirectURL(SSLFilters.groovy)
    at sun.reflect.GeneratedMethodAccessor738.invoke(Unknown Source)

Does anyone else have the same problem?

Thanks!
Kenny
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: StackOverflowError in GrailsWebRequest.getControllerName

purestgreen
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: StackOverflowError in GrailsWebRequest.getControllerName

purestgreen
In HTML this time... Hi, I've also just started getting this error. Our grails web app can remain stable for several days, then suddenly every single request that enters a particular controller's action closure causes the StackOverflow. A restart of the JVM clears the problem. We're using grails 1.3.7 with groovy 1.7.10 The Stack trace loop is: -- This bit loops
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:5370)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1587)
        at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1099)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3311)
        at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1111)
        at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:161)
-- End loop -- This bit is the entry point from out code.
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassGetPropertySite.callGetProperty(PojoMetaClassGetPropertySite.java:41)
        at com.bnpparibas.gmportal.cache.service.CacheFacade$_getAllGadgetDescriptors_closure1.doCall(CacheFacade.groovy:35)
-- CacheFacade.groovy line 35 is attempting to test the value gadgetDescriptor.gadgetApp.hidden, where gadgetDescriptor is an instance of a custom groovy object and gadgetApp is a field within it, which is an instance of a domain entity class. Any help greatly appreciated! Thanks, Simon
Loading...