Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autowiring doesn't match generics [SPR-5546] #10217

Closed
spring-issuemaster opened this issue Mar 5, 2009 · 2 comments
Closed

autowiring doesn't match generics [SPR-5546] #10217

spring-issuemaster opened this issue Mar 5, 2009 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Mar 5, 2009

Scott Battaglia opened SPR-5546 and commented

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.


Affects: 3.0 M2

Issue Links:

  • #14599 Autowiring of generic types
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Nov 4, 2014

Sébastien Deleuze commented

Closing this issue as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.