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的原理在补充.....



本文转自gaofeng36599 51CTO博客,原文链接:http://blog.51cto.com/786678398/1929473

相关文章
|
6月前
|
Java Spring
BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘ defined in class
BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘ defined in class
102 0
|
8月前
|
Java Apache Spring
解决required a single bean, but 2 were found问题
背景:springboot整合shiro中自定义Realm时出现 错误描述 Parameter 0 of method getDefaultWebSecurityManager in cn.ken.springboot_shiro.config.ShiroConfig required a single bean, but 2 were foun
|
9月前
|
消息中间件 Java RocketMQ
【Java】Error creating bean with name ‘functionBindingRegistrar‘ defined in class path resource的一种解决方式
【Java】Error creating bean with name ‘functionBindingRegistrar‘ defined in class path resource的一种解决方式
51 0
|
9月前
Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘bas
Error creating bean with name ‘userServiceImpl‘: Unsatisfied dependency expressed through field ‘bas
167 0
|
10月前
|
druid
A bean with that name has already been defined in class path resource and overriding is disabled.
A bean with that name has already been defined in class path resource and overriding is disabled.
147 0
|
12月前
|
Nacos
Nacos报错:Error creating bean with name ‘authFilterRegistration‘ defined in class path resource
Nacos报错:Error creating bean with name ‘authFilterRegistration‘ defined in class path resource
354 0
|
Java 数据库连接 网络安全
Error creating bean with name ‘attrAttrgroupRelationController‘
Error creating bean with name ‘attrAttrgroupRelationController‘
Error creating bean with name ‘attrAttrgroupRelationController‘
|
XML Java 数据库连接
【Error】:BeanCreationException: Error creating bean(Could not resolve resource location)
【Error】:BeanCreationException: Error creating bean(Could not resolve resource location)
285 0
【Error】:BeanCreationException: Error creating bean(Could not resolve resource location)
|
Java API Spring
A component required a bean named xxx that could not be found
A component required a bean named xxx that could not be found
A component required a bean named xxx that could not be found