We’re planning to use the Spring 3.1 cache abstraction instead of the Grails Spring cache plugin. I’ve experimented with it locally, but an issue occurred when using Spring el expressions like
@Cacheable(value = 'dashboardCache', key = 'sessionStorageService.getUser()', condition = 'sessionStorageService.getUser() != null')
public List<BusinessDashboard> getUserDashboards(String serverName, SessionStorageService sessionStorageService) { ... }
the following error occurs when executing the integration test case
EL1008E:(pos 0): Field or property 'sessionStorageService' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'sessionStorageService' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'
I assume this behavior is caused by missing debug information – thus my question:
Can Spring el expressions be enabled in Grails apps, or is there any parameter to the compilation process to tell Grails to keep debug symbols in the class files?
(we’re running on Grails 2.0.1)
you should try ‘#sessionStorageService.getUser()’