전체/Spring Boot
Could not autowire. No beans of type found. error 해결
effortDev
2021. 2. 14. 18:20
component로 등록된 것은 @SpringBootApplication 어노테이션을 통해 componentscan을 한다고 한다.
Using Spring Boot
This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe
docs.spring.io
intellij에서는 component로 등록된 것을 @Autowired하여 사용하려면
Could not autowire. No beans of '' type found. 라는 error가 발생한다.
컴파일 및 서버 실행에 문제는 없지만 해당 오류를 수정 할 수 있다.
컴포넌트를 사용하려는 클래스 위에 컴포넌트를 스캔할 패키지명을 적어준다.
@ComponentScan(basePackages={"com.shlee.toy1.common.components"})
참조