您现在的位置是:网站首页 > 代码编程 > JAVA开发JAVA开发

【原】An attempt was made to call the method org.springframework.data.redis.cache.RedisCacheManager.<init>(Lorg/springframework/data/redis/core/RedisOperations;)V but it does not exist.

不忘初心 不忘初心 2020-10-03 围观() 评论() 点赞() JAVA开发

简介:将公司项目中的redis升级到2.1.3之后,发现项目启动不了了,直接报错:“Anattemptwasmadetocallthemethodorg.springframework.data.redis.cache.RedisCacheManager.<init>(Lorg/springframework/data/redis/core/RedisOperations;)Vbutitdo

将公司项目中的redis升级到2.1.3之后,发现项目启动不了了,直接报错:“An attempt was made to call the method org.springframework.data.redis.cache.RedisCacheManager.<init>(Lorg/springframework/data/redis/core/RedisOperations;)V but it does not exist.”。

An attempt was made to call the method org.springframework.data.redis.cache.RedisCacheManager.<init>(Lorg/springframework/data/redis/core/RedisOperations;)V but it does not exist.

详细错误信息如下:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-09-09 19:48:55.612 [main] ERROR o.s.b.diagnostics.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method org.springframework.data.redis.cache.RedisCacheManager.<init>(Lorg/springframework/data/redis/core/RedisOperations;)V but it does not exist. Its class, org.springframework.data.redis.cache.RedisCacheManager, is available from the following locations:
jar:file:/E:/repository/org/springframework/data/spring-data-redis/2.1.3.RELEASE/spring-data-redis-2.1.3.RELEASE.jar!/org/springframework/data/redis/cache/RedisCacheManager.class
It was loaded from the following location:
file:/E:/repository/org/springframework/data/spring-data-redis/2.1.3.RELEASE/spring-data-redis-2.1.3.RELEASE.jar

从错误信息中可以明确看到,这个问题是springboot和redis的版本不匹配所致,redis的版本是2.1.3.RELEASE,而项目中的springboot版本才1.5.3.RELEASE,由于公司项目中的springboot版本是写在基础core包中的,所以当时没有注意到二者同步升级。

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>

问题解决!!!

redisspringbootspring

看完文章,有任何疑问,请加入群聊一起交流!!!

很赞哦! ()

文章评论

  • 请先说点什么
    人参与,条评论

请使用电脑浏览器访问本页面,使用手机浏览器访问本页面会导致下载文件异常!!!

雨落无影

关注上方公众号,回复关键字【下载】获取下载码

用完即删,每次下载需重新获取下载码

若出现下载不了的情况,请及时联系站长进行解决

站点信息

  • 网站程序:spring + freemarker
  • 主题模板:《今夕何夕》
  • 文章统计:篇文章
  • 标签管理标签云
  • 微信公众号:扫描二维码,关注我们