new RedisCacheManager(redisTempl

2018-10-12  本文已影响91人  雨夏_
image

这个问题是由于使用了spring boot 2.0的问题,在spring boot 2.0中RedisCacheManager,没有以下构造器

 @SuppressWarnings("rawtypes")
    public RedisCacheManager(RedisOperations redisOperations) {
        this(redisOperations, Collections.<String> emptyList());
    }

可以修改为:

public CacheManager cacheManager(RedisConnectionFactory factory) {
        RedisCacheManager cacheManager = RedisCacheManager.create(factory);
        return cacheManager;
    }

参考链接:https://blog.csdn.net/sy793314598/article/details/80719224

上一篇下一篇

猜你喜欢

热点阅读