JAVA/error

[error] org.apache.ibatis.type.TypeException: The alias ...

sihyeong 2023. 8. 23. 21:03

발생한 에러

  • javax.servlet.ServletException: 서블릿 실행이 예외를 발생시켰습니다.
  • java.lang.ExceptionInInitializerError
  • org.apache.ibatis.exceptions.PersistenceException
  • org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. 
  • org.apache.ibatis.type.TypeException: The alias 'GoodsDTO' is already mapped to the value 'com.dto.GoodsDTO'.

발생 시점

  • 상품 DB와의 CRUD 구현 중 발생

 

해결 시도

1. 서버 재연결

  • DB 작업 후 확인하려 새로고침 버튼을 연타 중 해당 문제가 발생했고, 
  • 에러메시지의 최 상단부만 확인하는 안일안 행동 결과, 
  • 서버 재 부팅 중 많은 요청으로 인한 에러로 오판하여 서버를 지우고 다시 연결하였으나,
  • 역시나 같은 에러 발생

2. mybatis configuration의 <alias> 연결부분의 동일한 이름 중복 수정

  • 침착하게 에러코드를 위에서부터 읽으니 "The alias 'GoodsDTO' is already mapped to the value 'com.dto.GoodsDTO'." 부분이 보였다.
  • alias에 이미 GoodsDTO 부분이 정의되어 있다는 메시지로 확인 결과, GoodsDTO부분이 중복되어 있어 중복되지 않도록 다른 값으로 변경하여 문제 해결