org.springframework.beans.factory.BeanNotOfRequiredTypeException
2013-03-26 00:15
459 查看
整合spring和hibernate时老是遇上这个错误,查了半天找到了问题所在,现在还不是太了解,先贴出来,慢慢研究
写Junit测试类的时候
错误写法:
正确的写法:
写Junit测试类的时候
错误写法:
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml"); UserService us = applicationContext.getBean("userService",UserServiceImpl.class);
正确的写法:
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml"); UserService us = applicationContext.getBean("userService",UserService.class);
相关文章推荐
- org.springframework.beans.factory.BeanNotOfRequiredTypeException must be of type
- org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'faceAction' must be of
- org.springframework.beans.factory.BeanNotOfRequiredTypeException:
- 在使用Spring AOP 时,启动服务抛出异常: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- Spring-org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 异常:org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException的解决办法
- 【异常篇-spring】org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 运用spring时出现org.springframework.beans.factory.BeanNotOfRequiredTypeException: 错误
- org.springframework.beans.factory.BeanNotOfRequiredTypeException
- "org.springframework.beans.factory.BeanNotOfRequiredTypeException……" 错误解决方案
- org.springframework.beans.factory.BeanNotOfRequiredTypeException:
- 处理异常:org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named "" must be of type [org.apache.struts.action.Action
- 代理及注入之org.springframework.beans.factory.BeanNotOfRequiredTypeException
- org.springframework.beans.factory.BeanNotOfRequiredTypeException 错误,
- Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'dao' is exp
- Aurora-hec4.0_scaninvoice_异常_04_org.springframework.beans.factory.BeanNotOfRequiredTypeException
- Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [