2.解决方案
显示的是没有找到这个缓存空间,出现该问题其实还是配置文件的事情,在ehcache的配置文件中,需要配置缓存空间。
这里的name就是你的缓存空间的名称,要与你@Cacheable
中的value一致
可以参考这个 资源网站:http://www.okeyl.com
<!-- 这里的 user 缓存空间是为了下面的 demo 做准备 --> <cache name="user" eternal="false" maxElementsInMemory="100" overflowToDisk="false" diskPersistent="false" timeToIdleSeconds="0" timeToLiveSeconds="300" memoryStoreEvictionPolicy="LRU" />