• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

레포지토리 검색을 못한다네요 ㅠㅠ

22.03.15 18:00 작성 조회수 5.31k

0

Service required a bean of type 'kr.edu.randi.mvc.repository.ArticleRepository' that could not be found.

 

The injection point has the following annotations:

- @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'kr.edu.randi.mvc.repository.ArticleRepository' in your configuration.

 

@Autowired(required=true)를해봐도 안되네요...

 

아무리봐도 다른 곳이 없는데 ... 이상하네요 ㅠ

답변 1

답변을 작성해보세요.

1

MybatisConfiguration 클래스에 아래 어노테이션이 적용되어있는지 확인해보시구요

@MapperScan(basePackages = "kr.edu.randi.mvc.repository")

 

ArticleRepository 클래스에 아래 어노테이션이 추가되어있는지 확인해보시기 바랍니다.

@Repository

 

예제로 완성된 샘플소스에서는 위에 2개가 들어가있는 상태에요

답변주셔서 감사합니다.

 

찾아봐도 해답이 안나오네요.... 다시 질문입니다... ㅠㅠ

https://pastebin.com/yi58nP7S

링크안에 소스코드가 있어서 혹시 필요하시면 참고해주세요

 

라이브러리 버전설정을 잘못한게 있어서 다시 한 번 해보겠습니다.

@Repository인걸 마이바티스 버전 올려서 @Mapper로 바꾸니 되네요!

해결되서 다행입니다.

이번기회로 User Unknown 수강자님은 정말 좋은 오류 해결능력을 터득하신거같습니다.