Why can\'t I use @Autowired in this case?
@SpringBootApplication
public class Application {
@Autowired
BookingService bookingService;
Here's good article about @Autowired annotation: http://www.baeldung.com/spring-autowire
The @Autowired annotation can instantiate your injectables by defining @ComponentScan("namespace.with.your.components.for.inject") on config class
@Configuration
@ComponentScan("com.baeldung.autowire.sample")
public class AppConfig {}
All components must be marked by @Component annotation. It replaces the @Bean annotation.