You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
autowiring doesn't match generics [SPR-5546] #10217
I've created my own PersonFactory class that implements ObjectFactory<Person> and its labeled with @Component. I have a controller that has a property "private ObjectFactory<Person>" with autowired=true
There is only one ObjectFactory<Person>.
During bootstrap Spring can't seem to match the two up. It complains there is more than one ObjectFactory.
Apologies. I believe the feature actually works. Misconfiguration caused the specific bean to not instantiate.
However, the error message is slightly misleading/confusing:
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory org.openregistry.core.web.PersonController.personFactory; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.beans.factory.ObjectFactory] is defined: Unsatisfied dependency of type [interface org.springframework.beans.factory.ObjectFactory]: expected at least 1 matching bean
Activity
spring-projects-issues commentedon Mar 5, 2009
Scott Battaglia commented
Apologies. I believe the feature actually works. Misconfiguration caused the specific bean to not instantiate.
However, the error message is slightly misleading/confusing:
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.beans.factory.ObjectFactory org.openregistry.core.web.PersonController.personFactory; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.springframework.beans.factory.ObjectFactory] is defined: Unsatisfied dependency of type [interface org.springframework.beans.factory.ObjectFactory]: expected at least 1 matching bean
Probably not worth changing though.
spring-projects-issues commentedon Nov 4, 2014
Sébastien Deleuze commented
Closing this issue as requested.