• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring autowire many implementation of Interface

 
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

There are multiple classes are implementing interfaces, and then in a third class where we have autowired list, now I have made another class and extend it from the interface but its beans don't get registered
 
Sheriff
Posts: 17410
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not how the Spring autowiring mechanism works. You marked a field that is of type List<A> to be autowired. I doubt that's even possible because of generics type erasure. Search for more info about how autowiring in Spring works. This article looks ok: https://howtodoinjava.com/spring/spring-core/spring-beans-autowiring-concepts/
reply
    Bookmark Topic Watch Topic
  • New Topic