API 개발 하다가 아래와 같은 오류가 발생하였다.
Cannot invoke "java.lang.Integer.intValue()" because the return value of "com.example.studentmanagement.dto.StudentDTO.getAge()"
확인해보니 DTO 쪽에 아래처럼 int로 선언하지 않고 Integer로 선언한 것이 있었다.

Integer -> int로 수정 후 정상 작동하였다.

'IT > Java' 카테고리의 다른 글
[JAVA] 시간 지연하는 방법 (0) | 2024.05.13 |
---|---|
[JAVA] 현재 시간 구하는 방법 (0) | 2024.05.03 |
build.gradle httpclient 의존성 주입 에러 해결방법 (0) | 2024.05.02 |
Thymeleaf TemplateInputException 에러 해결방법 (0) | 2024.05.01 |
@Slf4j log.info 에러 cannot find symbol (0) | 2024.04.19 |