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>
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>
相关文章推荐
- JDK环境变量配置
- 图片爬虫程序 JAVA
- Trie树的java实现
- spring MVC访问静态文件,如jpg,js,css
- for JDK1.5 OR HIGHER
- Spring MVC静态资源处理
- 递归求解数组的和 Java实现
- Struts2 多文件上传
- Struts2 单文件上传
- JAVA基础--db17_javaMap集合_集合框架工具类
- 求解一个字符串的所有排列 java实现
- Java多线程3:Thread中的静态方法
- JAVA基础--db16_java泛型_map集合
- 动手动脑及java程序之用消息框进行数的运算
- JAVA基础--db15_java集合框架
- JAVA基础--db14_java基本类型包装类_集合框架
- 回文串-Java
- Iterator 模式
- Spring的包结构解析
- 【约数倍数算法】——求最大公约数、最小公倍数