Redis缓存管理器异常

时间:2018-12-19 10:41:34

标签: java spring-boot redis

在Spring Boot升级过程中获取此异常(见下文):

no suitable constructor found for RedisCacheManager(org.springframework.data.redis.core.RedisTemplate<java.lang.String,java.lang.Object>)
    constructor org.springframework.data.redis.cache.RedisCacheManager.RedisCacheManager(org.springframework.data.redis.cache.RedisCacheWriter,org.springframework.data.redis.cache.RedisCacheConfiguration,java.lang.String...) is not applicable
      (argument mismatch; org.springframework.data.redis.core.RedisTemplate<java.lang.String,java.lang.Object> cannot be converted to org.springframework.data.redis.cache.RedisCacheWriter)
    constructor org.springframework.data.redis.cache.RedisCacheManager.RedisCacheManager(org.springframework.data.redis.cache.RedisCacheWriter,org.springframework.data.redis.cache.RedisCacheConfiguration,boolean,java.lang.String...) is not applicable
      (argument mismatch; org.springframework.data.redis.core.RedisTemplate<java.lang.String,java.lang.Object> cannot be converted to org.springframework.data.redis.cache.RedisCacheWriter)

我们是否需要为Redis添加另一个版本 PFB,pom.xml包含有关使用Spring Boot启动器父级进行依赖管理的详细信息

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.Release</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.9</java.version>
        <springfox.version>2.6.0</springfox.version>
    </properties>
<dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>

        </dependency>
<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.SR2</version>
                <!-- <version>Brixton.SR5</version> -->
                <type>pom</type>
                <scope>import</scope>
            </dependency>
                    </dependencies>
    </dependencyManagement>

0 个答案:

没有答案