stokito / grails-cookie

Makes dealing with cookies easy. Provides an injectable service and tag to easily get, set, and delete cookies with one line
http://grails.org/plugin/cookie
16 stars 12 forks source link

groovy.lang.MissingMethodException in version 0.5 #7

Closed sergiomichels closed 10 years ago

sergiomichels commented 10 years ago

I have a Grails Filter that checks for the existence of a cookie though the request object. This works fine in the 0.4 version, but fails in the 0.5. Example:

class MyFilters {
  def filters = {
    langCheck(controller: '*', action: '*') {
      before = {
        def cookie = request.getCookie('mycookie') //here exception
      }
    }
  }
}

Stacktrace:

2013-10-16 09:39:15,905 [http-bio-8080-exec-1] ERROR StackTrace  - Full Stack Trace:
groovy.lang.MissingMethodException: No signature of method: org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper.getCookie() is applicable for argument types: (java.lang.String) values: [insoftExtUiLang]
Possible solutions: getCookies(), getLocale()
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
    at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at br.com.insoft4.insoftextui.lang.filters.LangFilters$_closure1_closure2_closure3.doCall(LangFilters.groovy:27)
    at br.com.insoft4.insoftextui.lang.filters.LangFilters$_closure1_closure2_closure3.doCall(LangFilters.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
dalew75 commented 10 years ago

Hi Sergio,

Try upgrading to 0.51. Something got lost for enhancing request,response in 0.5. Sorry about that.

sergiomichels commented 10 years ago

Yep, it's working now, thanks!