내가 보려고 만드는/Spring

[Spring MyBatis] Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

gaga_ 2021. 1. 28. 20:36

이 에러가 발생했다면 원인이 다양한데, 주된 원인은 다음과 같다.

 

  1. mapper id가 틀린 경우
  2. Parameter bean의 field 명이 틀린 경우
  3. sql.xml에서 정의된 namespace와 DAO에서 호출하는 namespace가 다를 경우
  4. mapper가 정의되어 있지 않거나 스펠링이 틀린 경우
  5. mapper에 정의된 namespace 명칭이 같은 application 내에 중복 될 경우

나는 mpper.xml 파일의 id와 DAOImp.java 파일에서 사용된 id가 대소문자가 일치하지 않아 발생했었다.