상세 컨텐츠

본문 제목

MyBatisSystemException 해결

트러블슈팅

by ksjsjsj 2024. 5. 20. 19:32

본문

HTTP 상태 500 – 내부 서버 오류 타입 예외 보고 메시지 Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'boardSeq' not found. Available parameters are [arg1, arg0, param1, param2] 설명 서버가, 해당 요청을 충족시키지 못하게 하는 예기치 않은 조건을 맞닥뜨렸습니다.

 

 

게시글 삭제기능을 구현하던 중 위와 같은 에러가 떴다.

컨트롤러, 서비스에는 파라미터가 잘 넘어갔는데 NoticeRepository (매퍼인터페이스) 에서

boardSeq가 인식이 안되어서 발생한 문제였다.

 

public int boardAttachDelete(@Param("boardSeq")Integer boardSeq, @Param("boardTypeSeq")Integer boardTypeSeq);

 

public int boardDelete(@Param("boardSeq")Integer boardSeq, @Param("boardTypeSeq")Integer boardTypeSeq);

 

다음과 같이 매개변수 앞에 @Param 애너테이션을 붙여줌으로써 변수를 찾지 못하는 문제를 해결했다

관련글 더보기