Heestory

org.springframework.beans.factory.UnsatisfiedDependencyException 본문

개발(~국비)/Spring

org.springframework.beans.factory.UnsatisfiedDependencyException

까만밀가루 2022. 7. 20. 19:07

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.jhta.spring02.service.productService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 

 


구글링 해도 딱히 뚜렷한 방법이 안나와서 매번 프로젝트 삭제하고 새로운 마음으로 다시하다 이러다 끝도 없겠다 싶어    강사님께 여쭤봄 

 

service와 controller가 제대로 연결되지 않아 생기는 에러 메세지

확인해야 할 것들

1.@service 어노테이션 확인

2.@controller 의 controller에서 서비스의 @Autowired 

3.root-context의 context

base-package 에 기본을 잘 썼는가?