본문 바로가기

Java/오류

(6)
[오류 / IntelliJ] error: (패키지명) does not exist error: (패키지경로) does not exist import (경로); Cannot resolve symbol ~ 패키지명을 한번 변경했다고 계속 위와같은 오류가 났다. import문 확인해봐도 경로에 문제는 없었다. Rebuild Project 해줬더니 해결!
[오류] HttpMessageNotReadableException : Required request body is missing DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public org.springframework.http.ResponseEntity ... 경로...Controller.deleteEntity(java.util.Map)] 프론트 쪽에서 아래의 함수로 서버에 요청을 보내고 export const deleteEntityApi = async (param) => { const response = await api.delete(`ent/${param}`); return response.data; } ** ..
[오류 / JPA] dentifier of (엔티티) an instance of Entity was altered from A to B identifier of an instance of (Entity) was altered [dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.orm.jpa.JpaSystemException: identifier of an instance of (엔티티) was altered from ( A ) to ( B ) with root cause 본질적으로는 JPA 영속성 관련 문제인데, (JPA에서는 객체들을 우선 영속성 컨텍스트에 등록(flush) 후에 db에 반영한다(commi..
[오류 / JPA] Caused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table Caused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table ['(테이블명)'] ( SchemaManagementException 오류 ) JPA 에서는 db테이블과 엔티티를 매핑해줘야 하는데, 이 때 테이블을 인식하지 못해서 발생한 오류. 원래는 @Table(name = "테이블명") 이렇게만 써줬는데, schema를 명시해주지 않아서, 테이블을 인식하지..
[오류] JSON parse error: Cannot deserialize value of type `java.util.ArrayList<java.util.Map<java.lang.String,java.lang.Object>>` from Object value (token `JsonToken.START_OBJECT`) JSON parse error: Cannot deserialize value of type `java.util.ArrayList` from Object value (token `JsonToken.START_OBJECT`) 데이터 타입 불일치 오류. => Postman에서 보내는 parameter의 데이터 타입을 잘못 써줘서 났던 오류였다. ( [ ] 괄호를 빼먹음 ) 컨트롤러에서 parameter를 List 타입으로 받아줬기 때문에 아래처럼 보내줘야 한다. ** Postman에서 쌍따옴표("")를 사용해야 오류가 안남. [ {"id" : "testId", "name" : "testNm"}, {"id" : "testId2", "name" : "testNm2"} ] 프론트에서 데이터를 json형태로 서버로 ..
[오류] No primary or single unique constructor found for interface java. No primary or single unique constructor found for interface java. => controller에서 @PutMapping으로 메소드를 실행했는데, @RequestBody / @ResponseBody 어노테이션을 빼먹어서 났던 오류. 제발 이런 오류는 안나게 하자!!!!!!!!!!!!!!!