In Previous article we have learned that Spring support different type of autowiring. One of them is byType.
Autowiring byType means whenever spring finds any property to be autowired, it will search for exactly one bean of given property type in container. If Spring find one(unique bean) it will autowire it. If it doesn’t find any, no auto wiring will be done(Property will not be set). If there are more than one bean of same type in container then Spring will throw Exception that byType can not be used here.