• Bug
  • Status: Resolved
  • 2 Major
  • Resolution: Not a Bug
  • ehcache
  • drb
  • Reporter: bunde
  • May 08, 2017
  • 0
  • Watchers: 2
  • May 08, 2017
  • May 08, 2017

Description

@Cacheable(value = “getServicesForEnvironmentAndrole”, key = “{#role , #environment}”) @RequestMapping(value = “/getServicesForEnvironmentAndRole”, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET) public @ResponseBody ResponseEntity<List> getServicesForEnvironmentAndRole(){}

The above works, but if you change Cacheable value to “getServicesForEnvironmentAndRole” with capital R then we receive cache not found exception.

2017-05-08 10:15:51.744 WARN 7400 — [nio-8080-exec-7] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: java.lang.IllegalArgumentException: Cannot find cache named ‘getServicesForEnvironmentAndRole’ for Builder[public org.springframework.http.ResponseEntity se.dice.operations.asd.controller.JsonController.getServicesForEnvironmentAndRole(java.lang.String,java.lang.String) throws java.lang.Exception] caches=[getServicesForEnvironmentAndRole] key=’{#role , #environment}’ keyGenerator=’’ cacheManager=’’ cacheResolver=’’ condition=’’ unless=’’ sync=’false’

Comments

Louis Jacomet Jacomet 2017-05-08

What is you Ehcache configuration? Did you forget the capital {{R}} in it?

David Bundgaard 2017-05-08

Yes sorry, I forgot all about the EHcache configuration!.

Close it due to pure Alzheimer condition.

Louis Jacomet Jacomet 2017-05-08

Closed as not a bug.

Let’s hope you recover ;-)