Error creating bean with name '***': Injection of resource dependencies failed,Bean named 'redisService' is expected to be of type

Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'epAtreusEquipmentInfoServiceImpl': 
Injection of resource dependencies failed; 
nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named 'redisService' is expected to be of type 'com.xiaojukeji.epower.atreus.biz.service.redis.ConnectorRedisService' 
but was actually of type 'com.xiaojukeji.epower.direct.core.service.RedisService'

异常出现的背景:

@Autowired
private RedisService redisService;
@Resource
private ConnectorRedisService redisService;

以上同属姓名同时出现即会报错

改成这个就不会报错,或者属姓名不相同也可以

@Autowired
private ConnectorRedisService redisService;
posted @ 2021-08-06 11:44  夜旦  阅读(1080)  评论(0编辑  收藏  举报