Error creating bean with name

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error creating bean with name相关的知识,希望对你有一定的参考价值。

今天碰到一个特别奇怪的问题:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ecfCustomerEditService‘: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sinosoft.framework.service.TransformService com.sinosoft.ecif.service.impl.ECIFCustomerEditServiceImpl.transformService


Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transformService‘: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.sinosoft.framework.service.impl.TransformServiceImpl.trasnObject(java.lang.Object); nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [java.lang.Object] is defined: expected single matching bean but found 88: 


有一种感觉是这里的问题transformService,但是没找到具体原因,三个项目只要引入了transformService启动就报错,通过同事的帮忙,先是把用到transformService的地方全注释掉,就没有问题了,问题定位到了transformService这里,最后发现在transformServiceImpl里面事项方法上面写了

@Autowired

导致重复注入了,有时间看看autowired的原理在补充.....

本文出自 “summit” 博客,请务必保留此出处http://786678398.blog.51cto.com/2082557/1929473

以上是关于Error creating bean with name的主要内容,如果未能解决你的问题,请参考以下文章

Error creating bean with name ‘requestMappingHandlerMapping‘

react(85)--error:Error creating bean with name ‘onlineStudyController‘:

Error creating bean with name 'eurekaAutoServiceRegistration'

Spring 报错:Error creating bean with name

Error creating bean with name

Error creating bean with name 'transactionManager'