Understanding Constructor injection by XML configuration

Let’s say we have a parameterized constructor in student class. Bean creation will be failed. See example below.

Merchant.java


Config file – remove autowiring tag from this xml


Client.java


Error on console


To solve this we will change implementation as below.

Config file – remove autowiring tag from this xml and add below lines.