zoukankan      html  css  js  c++  java
  • Error creating bean with name 'unMblTotController': 注入失败

    今天新来的小伙子,进公司做项目,然后自己新建了包,出了以下错误

    y.UnsatisfiedDependencyException: Error creating bean with name 'unMblTotController': 
    Unsatisfied dependency expressed through field 'dataService'; nested exception is org.springframework.beans.
    factory.UnsatisfiedDependencyException: Error creating bean with name 'unMblTotServiceImpl': Unsatisfied dependency expressed
     through field 'unMblTotMapper'; 
     nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean found for dependency 
     [com.yd.ydsetl.unmbl.mapper.UnMblTotMapper]: expected at least 1 bean which qualifies as autowire candidate.
    Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

    错误的意识,controller,service,dao注入失败,

    那么可以说明是配置上的问题,跟代码上没有关系,

    可以知道应该是包扫描上出现问题了,出现了命名的问题,

    我们可以找到

    spring-mvc.xml  或者spring.xml.还有spring-dao.xml文件去查看相关的包扫描,是否存在相关问题,

    新来小哥,骗过了编译器,但是在运行的时候出现这个错误,说明不是代码,而是相关配置问题,

  • 相关阅读:
    Ext.FormPanel-----FieldSet的用法
    DAO层,Service层,Controller层、View层
    PageProxy分页的实现
    Layout布局(补充)
    Ext--Layout(布局)
    DirectEvents用法
    Linq的使用
    字符串注入攻击
    winform(C#)里弹出“确定”“取消”对话框
    C#的数组
  • 原文地址:https://www.cnblogs.com/xiufengchen/p/11309083.html
Copyright © 2011-2022 走看看