
인텔리제이 로그창
[ERROR] o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class com.example.springEssential.data.dto.ProductDto]] with root cause
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.example.springEssential.data.dto.ProductDto` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 2, column: 3]
Product 엔티티에 @Getter어노테이션 추가ProductDto클래스-@NoArgsConstructer 추가 service 계층에서
product.setPrice(productDto.getPrice()); product.setStock(product.getStock());setStock을 할때 다음과 같이 잘못입력했다. entity가 아닌 dto를 이용해서 stock값을 받아와야됨.
product.setStock(productDto.getStock())으로 변경
