스프링부트에 마이바티스를 연동하는데 mapper 인터페이스를 인식 못할때

이주인·2023년 3월 30일
1

스프링 공부

목록 보기
10/11

consider defining a bean of type mapper in your configuration ~ 같은 오류 메시지가 뜰때

@MapperScan	//문제의 그녀석
@SpringBootApplication
public class ItemService2Application {

	public static void main(String[] args) {
		SpringApplication.run(ItemService2Application.class, args);
	}

}

main class에 @MapperScan 어노테이션을 넣어주니 해결됬다.

'consider defining a bean of type mapper in your configuration mybatis'라고 검색하니 해결방법을 찾을 수 있었다.

짜증나는 것은 그동안 계속 저 오류 페이지가 나서 설정도 갈아 없고 매퍼 파일도 다 갈아엎었는데, 저 어노테이션을 넣어주니까 잘 동작하는 것이다.

심지어 이젠 저 어노테이션을 지워도 잘 작동한다.

짜증나

profile
컴공

0개의 댓글