zoukankan      html  css  js  c++  java
  • 同属姓名注入spring报错

    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;
    
    三分热血值得你十二分努力。
  • 相关阅读:
    Asp.Net 获取客户端真实IP方法总结
    C# 中英文符号互转(半角全角互转)
    执行git commit命令提示: “Please tell me who you are”的解决方案
    Tools
    VSC
    DevOps
    VSC
    DevOps
    DevOps
    K8S
  • 原文地址:https://www.cnblogs.com/woooodlin/p/15532582.html
Copyright © 2011-2022 走看看