강의에서 mapper.UserMapper.xml 파일을 com.my.프로젝트명 아래 만들었다.
똑같이 진행했지만 에러 발생.
### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for UserMapper.메소드명
### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for UserMapper.메소드명]
서치해 본 결과, IntelliJ와 Eclipse의 차이임을 알아냈다. (강의는 Eclipse, 나는 InteliJ 사용)
InteliJ에서 com.my.프로젝트명 폴더는 main.java 아래 위치한다. (Eclipse와의 차이점)
Intelij에서 MyBatis는 기본적으로 resources 폴더에서 매퍼 파일(xml)을 찾는다.
이 부분이 에러가 발생한 원인이다. 해결 방법은 간단하다.
(좌) 수정 전 / (우) 수정 후
mybatis.mapper-locations=classpath:mapper/*.xml
FIN.
Spring Boot JSP "Error resolving template" 오류 해결하기 (0) | 2025.02.01 |
---|---|
Spring Boot에서 CSS 파일 로드 오류 해결하기 (1) | 2025.01.28 |
댓글 영역