Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
autowiring doesn't match generics [SPR-5546] #10217
I've created my own PersonFactory class that implements ObjectFactory<Person> and its labeled with
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.
Affects: 3.0 M2
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.