首页 / 更多教程 / Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redi
Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redi
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redi,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2201字,纯文字阅读大概需要4分钟。
内容图文
![Consider revisiting the entries above or defining a bean of type](/upload/InfoBanner/zyjiaocheng/890/b944ef86f8c4489fb4241d3d288e426b.jpg)
Consider revisiting the entries above or defining a bean of type ‘org.springframework.data.redis.connection.RedisConnectionFactory’ in your configuration.
Action:
Consider revisiting the entries above or defining a bean of type ‘org.springframework.data.redis.connection.RedisConnectionFactory’ in your configuration.
-
问题描述
使用Spring Boot Redis缓存,项目启动时报错
The following candidates were found but could not be injected: - Bean method 'redisConnectionFactory' in 'JedisConnectionConfiguration' not loaded because @ConditionalOnClass did not find required classes 'org.apache.commons.pool2.impl.GenericObjectPool', 'redis.clients.jedis.Jedis' - Bean method 'redisConnectionFactory' in 'LettuceConnectionConfiguration' not loaded because @ConditionalOnClass did not find required class 'io.lettuce.core.RedisClient'
控制台提示:
Action: Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration.
-
问题解决
其实就是导入依赖不全,检查pom.xml:
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.47</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> <dependency> <groupId>io.lettuce</groupId> <artifactId>lettuce-core</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency> </dependencies>
如上导包之后,问题解决
内容总结
以上是互联网集市为您收集整理的Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redi全部内容,希望文章能够帮你解决Consider revisiting the entries above or defining a bean of type 'org.springframework.data.redi所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。