2. Register AutowiredAnnotationBeanPostProcessor

To enable @Autowired, you have to register ‘AutowiredAnnotationBeanPostProcessor‘, and you can do it in two ways :

1. Include <context:annotation-config />

Add Spring context and <context:annotation-config /> in bean configuration file.