关于Spring中org.springframework.beans.factory.UnsatisfiedDependencyException异常
2013-03-18 17:19
676 查看
关于Spring中org.springframework.beans.factory.UnsatisfiedDependencyException异常
这个异常是由于在applicationContext.xml中关于bean的autowirte装配类型,在类型byName,byType,constructor三种类型中,可能会出现因无法自动装配而产生题目中的异常。下面介绍一下关于autowrite的集中装配类型:
1)no:采用自动装配。必须使用ref直接饮用其他Bean<ref bean="JavaBean"/>
2)byName:以属性名区分自动装配。在容器中寻找与JavaBean属性名相同的JavaBean,并假期自动装配到JavaBean中。
3)byType:以属性类型区分自动转配
4)constructor:通过构造方法的参数类型自动装配
5)autudetect:首先使用constructor方式自动装配,然后使用byType方式
在使用自动装配的时候,吧容易出现问题的JavaBean采用手动装配。
相关文章推荐
- springboot Junittest 报异常:org.springframework.beans.factory.UnsatisfiedDependencyException:
- org.springframework.beans.factory.UnsatisfiedDependencyException 异常这么解决
- org.springframework.beans.factory.UnsatisfiedDependencyException异常
- SSM中关于service中mapper注入失败org.springframework.beans.factory.UnsatisfiedDependencyException: Error crea
- org.springframework.beans.factory.UnsatisfiedDependencyException异常
- Spring使用@scope("session")爆org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- org.springframework.beans.factory.UnsatisfiedDependencyException
- 启动项目报错:org.springframework.beans.factory.UnsatisfiedDependencyException
- Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wi
- spring + redis + org.springframework.beans.factory.UnsatisfiedDependencyException:
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com
- org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name'se
- 关于 Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException 错误
- 题目:org.springframework.beans.factory.BeanCreationException(hibernate中的jar包和spring中的jar包冲突)异常产生的原因和解决方案。
- Spring中配置AOP出现org.springframework.beans.factory.BeanCreationException异常