[Solved] 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'

Background of abnormal occurrence:

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

If the above names appear at the same time, an error will be reported

If you change to this, no error will be reported, or the genus name is not the same.

@Autowired
private ConnectorRedisService redisService;

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *