Tech/trouble
동적 SQL 쿼리만들다가 오타난 경우
glqdlt
2017. 3. 26. 12:54
사유: org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'cri' on field 'perPageNum': rejected value [10$searchType=c];
codes [typeMismatch.cri.perPageNum,typeMismatch.perPageNum,typeMismatch.int,typeMismatch];
arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [cri.perPageNum,perPageNum]; arguments []; default message [perPageNum]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'perPageNum';
nested exception is java.lang.NumberFormatException: For input string: "10$searchType=c"]
잠시 짬이 나서 Okky 에서 쿰척거리다가 도움을 외치던 초보 분을 보곤 트러블 슈팅을 해보았다.
.이 Trace를 해석해보자.
스프링의 빈 프로퍼티를 바인딩하는 데 에러가 났다.
cri 라는 객체의 필드중에 perPageNum 이라는 거에서 거부반응이 일어남.
perPageNum 의 값이 10$searchType=c 로 들어가있음.
(아마 파라메터를 붙이기위해서 & 쓰려다가 $ 오타를 낸듯)
이 type을 알수 없다.
perPageNum에선 NumberFormatException 이 일어났다.
perPageNum에 들어간 value가 숫자 포맷이 아니어서 에러를 냈다...
&를 쓰려다가 $를 써서 스프링내부에서 파싱이 잘못되어서 들어간 걸로 보인다,
결론은 야근의 야근으로 환각증세를 일으킨 것으로 보임.
야레야레