0

Could the Autowiring using @Autowired spring annotation happen at class initialization, and not just before constructor call ? thanks for help

C2S
  • 7
  • 3
  • possible duplicate [how-does-autowiring-work-in-spring](http://stackoverflow.com/questions/3153546/how-does-autowiring-work-in-spring) – Sajjad May 04 '17 at 15:49

2 Answers2

0

Ass described here: https://blog.jdriven.com/2015/03/spicy-spring-different-ways-of-autowiring/:

Constructor Autowiring

Method Autowiring

with this ways of inject dependencies you have more control over the logic you want to apply during a bean initialization.

rjsperes
  • 65
  • 1
  • 8
0

To elucidate on what rperes said, the InjectableBean is being injected at construction, but if you have not configured InjectableBean as a component to be injected, then you will have problems.

Check that your configuration for InjectableBean is correct. Have a look at Spring: Properly setup @ComponentScan

Community
  • 1
  • 1
Breandán Dalton
  • 1,619
  • 15
  • 24