错误栈:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisReferenceResolver': Unsatisfied dependency expressed through constructor parameter 0: Could not convert argument value of type [xxx] to required type [org.springframework.data.redis.core.RedisOperations]: Failed to convert value of type 'com.youdao.outfox.intergame.store.cache.RedisTemplate' to required type 'org.springframework.data.redis.core.RedisOperations'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'xxx.store.cache.RedisTemplate' to required type 'org.springframework.data.redis.core.RedisOperations': no matching editors or conversion strategy found...

解决方法:

第一种:配置文件中禁用

application.yml中添加

spring:
  data:
    redis:
      repositories:
        enabled: false

第二种:启动类中使用注解禁用

xxApplication.java中添加

@SpringBootApplication(exclude = {
        RedisAutoConfiguration.class,
        RedisRepositoriesAutoConfiguration.class
})

 

 ~

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-11-03
  • 2021-08-25
  • 2021-05-29
  • 2022-12-23
猜你喜欢
  • 2021-11-07
  • 2021-03-30
  • 2021-11-14
  • 2022-12-23
  • 2021-12-12
  • 2021-08-30
  • 2021-12-24
相关资源
相似解决方案