1. 程式人生 > >Error creating bean with name

Error creating bean with name

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