Search code examples
javaspringsynchronizationehcache

EhCache @Cacheable Throws Exception When Sync


When calling a method annotated with @Cacheable with the sync flag set to true, I get the following exception:

java.lang.AbstractMethodError: org.springframework.cache.ehcache.EhCacheCache.get(Ljava/lang/Object;Ljava/util/concurrent/Callable;)Ljava/lang/Object;


Solution

  • For some reason a library was setting the spring-context-support version to 4.2.x instead of 4.3.x in my build. This caused the synchronous get method to not be implemented. Make sure your spring-context-support library is at least at 4.3.