首页 > 移动平台 > 详细

mybatis整合ss的时候,无法autowire使用mapper的自动注入,找不到bean:NoSuchBeanDefinitionException

时间:2016-04-05 01:55:05      阅读:13918      评论:0      收藏:0      [点我收藏+]
    1. org.springframework.beans.factory.BeanCreationException:
    2. Error creating bean with name userDaoImpl: Injection of autowired dependencies failed;
    3. nested exception is org.springframework.beans.factory.BeanCreationException:
    4. Could not autowire field: private com.dao.UserMapper com.service.UserDaoImpl.userMapper;
    5. nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.dao.UserMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


原因,在spring的配置文件中扫不到mapper下的dao文件们,可能就是路径写错了。


我的原因是:路径多了一个classpath:
技术分享

所以把classpath去掉就好了。




mybatis整合ss的时候,无法autowire使用mapper的自动注入,找不到bean:NoSuchBeanDefinitionException

原文:http://www.cnblogs.com/share2015/p/5353501.html

(5)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!