# Two constructors: which one does Spring pick?


--- TwoConstructorsService: no-arg + one-arg, neither annotated ---
[no-arg constructor used]
gateway injected: false

--- TwoConstructorsNoDefault: one-arg + two-arg, neither annotated ---
org.springframework.beans.factory.BeanCreationException
Error creating bean with name 'twoConstructorsNoDefault': Failed to instantiate [com.ankurm.coredi.injection.TwoConstructorsNoDefault]: No default constructor found
root cause: java.lang.NoSuchMethodException: com.ankurm.coredi.injection.TwoConstructorsNoDefault.<init>()

--- TwoConstructorsAnnotated: @Autowired on one constructor ---
[annotated constructor used]
