Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: Grails-Springcache 1.3.1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
When springcache plugin is installed I get an exception when I change my taglib class and Grails reloads it.
"groovy.lang.MissingPropertyException: No such property: fullName for class: com.foo.MyTagLib"
This happens both in Grails 1.3.7 and 2.0.0
SpringcacheGrailsPlugin.groovy:
def doWithApplicationContext = { applicationContext ->
def decorator = new CachingTagLibDecorator(applicationContext.springcacheService)
for (tagLibClass in application.tagLibClasses) {
decorator.decorate(tagLibClass, applicationContext."${tagLibClass.fullName}")
}
}
I am seeing the same behaviour with grails 1.3.7 and 2.0.1.
The following patch works for me:
--- SpringcacheGrailsPlugin.groovy 2011-02-16 13:29:58.000000000 +0100 +++ SpringcacheGrailsPlugin.groovy 2012-02-26 14:58:18.976176345 +0100 @@ -137,7 +137,8 @@ def onChange = { event -> if (application.isTagLibClass(event.source)) { - new CachingTagLibDecorator(event.ctx.springcacheService).decorate(event.ctx."$event.source.fullName") + def tagLibClass = application.tagLibClasses.find { it.fullName == event.source.name } + new CachingTagLibDecorator(event.ctx.springcacheService).decorate(tagLibClass, event.ctx[event.source.name]) } }