您的位置:首页 > 编程语言 > Java开发

springmvc整合mybatis出现Could not autowire field:No matching bean of type错误

2015-10-01 19:11 866 查看
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.us.service.UsersService 。。。。。

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.us.service.UsersService] 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)}

==============================

解决方法是

在applicationContext-service.xml中配置底下的代码。。。。。

<!-- 用户管理的service -->

<!-- <bean id="usersService" class="com.us.service.impl.UsersServiceImpl"/>

--></beans>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: