org.springframework.beans.factory.UnsatisfiedDependencyException..{@org.springframework.beans.factory.annotation.Autowired(required=true)}

2022. 9. 24. 15:08JAVA & SPRING/에러

반응형

오늘의 에러

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'replyController': Unsatisfied dependency expressed through field 'replyService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.shop.service.ReplyService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
[Catalina-utility-2] ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed

해결

어노테이션을 작성하지 않거나, 오타가 있으면 에러가 난다고 인터넷에 그랬는데 아무리 찾아도 어노테이션 빠짐없이 다 적었고 오타도 없었다...

문제는 service 인터페이스를 구현하는 serviceImpl 클래스에서 다른 매퍼 클래스를 구현하도록 작성해놓은 것.

Oh My Time... 아까운 내 시간 다 버렸다.

serviceImpl implements replyService로 변경하고 실행하니 잘된다.


오타나 어노테이션뿐만 아니라 올바른 인터페이스 구현하도록 설정한 것인지 다시 확인하자 ~!

반응형