티스토리 뷰

 

에러메세지

org.apache.ibatis.reflection.ReflectionException: 
There is no getter for property named 'blNo' in 'class com.bookforyou.bk4u.reply.model.vo.Reply'

 

에러메세지 상세

심각: 경로 [/bk4u]의 컨텍스트 내의 서블릿 [appServlet]을(를) 위한 Servlet.service() 호출이,
근본 원인(root cause)과 함께, 예외 [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'blNo' in 'class com.bookforyou.bk4u.reply.model.vo.Reply']을(를) 발생시켰습니다.

 

 

원인

해당 클래스에 blNo(게시글번호)에 대한 getter가 없다는 의미이다.

 

당연하다.

Reply클래스에서 blNo에 대한 값은 다른 컬럼으로 받아오는데

mapper에서 받아오는 값의 name으로 그대로 써버림

 

 

해결방법

mapper파일에서 값을 받아오는 컬럼명으로 알맞게 변경해준다.

이런 실수 뿐만 아니라 주로 오타, 대문자 실수가 많이 있음!

<insert id="insertReply">
		insert 
		  into reply
		     ( 
		       reply_no
		     , mem_no
		     , reply_type
		     , ref_post
		     , reply_content
		     , reply_refno
		     , depth
		     )
		values
		     ( 
		       seq_rno.nextval
		     , #{memNo}
		     , 2
		     , #{refPost} // 여기 자리에 blNo라고 써서 오류남
		     , #{replyContent}
		     , #{replyRefNo}
		     , #{depth}
		     )
	</insert>
반응형