Error creating bean with name 'hotWordServiceImpl': Unsatisfied dependency expressed through field '
来源:互联网 发布:o2o商城源码 编辑:程序博客网 时间:2024/06/02 01:12
错误Error creating bean with name 'hotWordServiceImpl': Unsatisfied dependency expressed through field 'redis';
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
'org.springframework.data.redis.core.RedisTemplate<java.lang.String, java.lang.String>' available: expected at
least 1 bean which qualifies as autowire candidate. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true),
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type
'org.springframework.data.redis.core.RedisTemplate<java.lang.String, java.lang.String>' available: expected at
least 1 bean which qualifies as autowire candidate. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true),
@org.springframework.beans.factory.annotation.Qualifier(value=hotwordRedisTemplate)}
-------------------------------------------------------------------------------------------------------------------------
原因:调用的时候是这样写的
@Autowired
@Qualifier("hotwordRedisTemplate")
private RedisTemplate<String, String> redis;
但是接口定义是这样的
@Bean(name = "hotwordRedisTemplate")
public RedisTemplate<String, Object> cacheRedisTemplate() {
......
-------------------------------------------------------------------------------------------------------
修正:把标红的地方换成String就OK了
阅读全文
0 0
- Error creating bean with name 'hotWordServiceImpl': Unsatisfied dependency expressed through field '
- Error creating bean with name 'userService' defined in class path resource [beans.xml]: Unsatisfied dependency expressed through
- Unsatisfied dependency expressed through bean property 'dataSource'
- .jpa.HibernateJpaAutoConfiguration Unsatisfied dependency expressed through constructor parameter 0
- Error creating bean with name...
- Error creating bean with name 。。。
- Error creating bean with name
- Error creating bean with name
- Error creating bean with name
- Error creating bean with name 'menuController': Injection of autowired dependency……
- Error creating bean with name 'menuController' Injection of autowired dependency…
- Error creating bean with name jbpmConfiguration
- Error creating bean with name 'sessionFactory' 问题
- Error creating bean with name 'handlerMapping'
- Error creating bean with name 'sessionFactory' defined
- Error creating bean with name 'xxx'
- Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer'
- Error creating bean with name '****'的解决方法
- 使用js和jquery的常见操作
- 数据库三大范式
- 数据库三大范式
- 计算机网络自顶向下学习笔记(计算机网络和因特网一)
- 深度学习总结(一)——参数初始化
- Error creating bean with name 'hotWordServiceImpl': Unsatisfied dependency expressed through field '
- bootstrap模态框
- JDK TOMCAT环境变量设置
- Python3.x 函数实例
- 数据结构实验之图论六:村村通公路
- Qt状态机场景模拟
- lambda表达式
- Android TextView使用HTML处理图片文字混合显示
- 运算符重载(复数类(Complex))