Java & Spring/Error
[에러해결] Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.codestates.entity_mapping.single_mapping.Member
에러코드 Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.codestates.entity_mapping.single_mapping.Member 원인 : @Entity 애너테이션만 추가하고, 식별자 역할을 하는 멤버변수에 @Id 애너테이션을 추가하지 않은 경우 발생 해결방법 : 식별자역할 멤버변수(일반적으로 엔티티이름Id 형식)에 @Id 애너테이션 붙이기 권장사항 : 파라미터가 없는 기본 생성자를 필수로 추가하기
![[에러해결] IntelliJ to Postman - 한글깨짐 오류](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcTnutK%2FbtrKUvhuNCf%2FAAAAAAAAAAAAAAAAAAAAAHOUitzFZHAXOeSFYLz0pEI7afBMGhXrSCSgbK1W1L7n%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3Dagn6zEOyLVn28AmBeMEBKIbJfeM%253D)
[에러해결] IntelliJ to Postman - 한글깨짐 오류
문제 IntelliJ에서 작성한 파일을 Postman을 통해 JSON데이터로 받아올 때, 한글이 깨지는 오류가 발생 아래는 한글이 깨져나오는 예시 (�솉湲몃룞 == 홍길동) { "data": [ { "memberId": 20, "email": "hgd20@gmail.com", "name": "�솉湲몃룞", "phone": "010-2020-2020" }, ... ] } 해결방법 필자의 경우 2가지 모두 수행 했을 때, 정상적으로 JSON 데이터가 찍혀나왔다. 방법 1 ) IntelliJ 플러그인 설치 : JavaDoc과 Tabnine AI 설치 방법 2 ) 파일 => 파일 프로퍼티 => 파일 인코딩 => 더보기 => UTF-8 이렇게 설정 후 IntelliJ를 재시작하고 실행해보니 정상작동했다.
![[에러해결] postman - Caused by: java.lang.NumberFormatException: For input string: "1,size=20"](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FctNVCN%2FbtrKT1gzahz%2FAAAAAAAAAAAAAAAAAAAAAFYiUR7cdqt3dtSSWc6Y9A65u20zaSC5Bgu7tZFsJgNL%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DfIhykbfrAofNcHoQneXPa2Odsbo%253D)
[에러해결] postman - Caused by: java.lang.NumberFormatException: For input string: "1,size=20"
에러코드 Caused by: java.lang.NumberFormatException: For input string: "1,size=20" Postman 응답 { "status": 500, "message": "Internal Server Error", "fieldErrors": null, "violationErrors": null } 원인 : Param에 적어놓고 send해야하는데, body에 JSON날리는게 익숙해져서 뻘짓을 하고있었다. 해결방법 : 아래와 같이 Params에서 파라미터를 설정해주고 value값을 날려주면 정상 동작한다
![[에러해결] Content type 'text/plain;charset=UTF-8' not supported](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FoB1cB%2FbtrKLgcNUIF%2FAAAAAAAAAAAAAAAAAAAAAEY5EK-iBSzciap6nF9En2HfgPMq2tBOXRbscd7OeP13%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3D3Im2f2%252Fk%252FSAP7xXwPYce5klUp44%253D)
[에러해결] Content type 'text/plain;charset=UTF-8' not supported
에러 코드 ontent type 'text/plain;charset=UTF-8' not supported 원인 Postman에서 자동 생성된 Content type이 JSON으로 안되어 있기 때문에 발생 (즉, 스프링부트 사용 중 형식에 맞지 않는 데이터 타입으로 요청을 보내서 발생한 문제) 해결책 Postman에서 요청 데이터 타입을 변경해서 다시 요청한다. 즉, Body => raw => JSON 으로 전환 후 요청