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文件去查看相关的包扫描,是否存在相关问题,

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM