• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    해결됨

MyBatis 적용시 오류가 납니다.

23.05.12 18:00 작성 조회수 1.14k

4

MyBatis 적용 2 에서 테스트 실행시 오류가 발생하여 질문드립니다. @Import(MyBatisConfig.class)를 적용한뒤 부터 빈을 찾을수없다고 뜹니다..

Description:

Parameter 0 of constructor in hello.itemservice.config.MyBatisConfig required a bean of type 'hello.itemservice.repository.mybatis.ItemMapper' that could not be found.

Action:

Consider defining a bean of type 'hello.itemservice.repository.mybatis.ItemMapper' in your configuration.

2023-05-12 17:54:39.382 ERROR 1252 --- [ Test worker] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@32f0fba8] to prepare test instance [hello.itemservice.domain.ItemRepositoryTest@2f521c4]

이게 핵심 에러내용인것같은데, ItemMapper를 찾을수가 없다고 뜹니다.
강의 소스 코드의 경우 MyBatis적용시 문제없이 진행되어서 더 헷갈리네요.. 도와주세요ㅜㅜ

답변 1

답변을 작성해보세요.

2

ᄋᄋ님의 프로필

ᄋᄋ

질문자

2023.05.12

제가 만든 itemservice가 아닌 강의시작할때 제공한 itemservice라는것을 간과했네요..
build.gradle에서 implementation을 2.2.0 버전으로 넣어서 해결했습니다..