삽질 1. Invalid bound statement (not found)
mapper 설정 경로에 주석처리가 되어있어서 mapper를 인식하지 못하는 오류가 계속 발생했다.
주석처리 된 부분을 해제 해 줬다.
다음에도 not found 오류가 뜨면 꼭 설정부터 확인해야겠다.
너무 기본적인 부분이었는데 옆에 인턴 동기분한테 여쭤봐서 죄송했다 :(
삽질 2. DB에 insert가 안되는 문제
2022-11-29 16:51:10.475 ERROR 17900 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException:
### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect integer value: '' for column 'LOWER_PART_ID' at row 1
### The error may exist in file [C:\Users\zepo\Desktop\CMS\bin\main\mapper\part\Part_SQL.xml]
### The error may involve kr.co.neighbor21.cms.part.mapper.PartMapper.savePart-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO tb_part (PART_ID, UPPER_PART_ID, LOWER_PART_ID, PART_NAME, LEVEL) VALUES ( ?, ?, ?, ?, ? ) ;
### Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect integer value: '' for column 'LOWER_PART_ID' at row 1
; Data truncation: Incorrect integer value: '' for column 'LOWER_PART_ID' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect integer value: '' for column 'LOWER_PART_ID' at row 1] with root cause
postman으로 API를 테스트할 때 보내는 데이터 형식의 문제였다.
table 생성 시 지정한 자료형과 내가 API를 테스트 할 때 보낸 자료형이 맞지 않는 것이 문제였다
오늘 굉장히 기본적인 부분들에 관련한 실수가 많았던 것 같다
정신 똑바로 차리고 코딩해야지 :(
'etc > 2023 하반기 인턴' 카테고리의 다른 글
[최종프로젝트/CMS] 221201_수정 필요 (0) | 2022.12.01 |
---|---|
[최종프로젝트/CMS] 221130 _ Github branch 작업/ Failed to configure a DataSource (0) | 2022.11.30 |
중간 평가 회고 (0) | 2022.11.16 |
댓글