首页   >   代码编程   >   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.

将公司项目中的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>

问题解决!!!

雨落无影

QQ群Ⅰ: 686430774 (已满)

QQ群Ⅱ: 718410762

QQ群Ⅲ: 638620451 (已满)

QQ群Ⅳ: 474195684

QQ群Ⅴ: 463034360 (已满)

QQ群Ⅵ: 879266502

QQ群Ⅶ: 627786015 (已满)

工作5分钟,吹逼2小时: 855525339 (娱乐消遣,广告狗勿进)

如果文章有帮到你,可以考虑请博主喝杯咖啡!

分享到:

欢迎分享本文,转载请注明出处!

作者:不忘初心

发布时间:2020-10-03

永久地址:https://www.jiweichengzhu.com/article/fd5c2109eed0459b94c1378fc629ebea

评论