我正在尝试使用java配置在Spring启动应用程序中使用多个缓存框架
但是,我无法将org.ehcache.Cachemananger对象转换为springframework.cache.CacheManager对象以使其在缓存解析器中注册。
下面的代码在构建时显示错误:
@Bean(name="ehCacheManager")
public CacheManager ehcacheManager() {
return new JCacheCacheManager(jCacheCacheManager().getObject());
}
@Bean(name="ehCacheResolver")
public CacheResolver ehcacheResolver() {
return new CustomCacheResolver(ehcacheManager());
}
显示错误:
[ERROR] cache/mongo/configure/CacheConfiguration.java:[55,16] canno
t access javax.cache.CacheManager
class file for javax.cache.CacheManager not found
有什么办法可以将javax CacheManager转换为Spring CacheManager吗?