Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 자료형
- 최대공약수
- 프로그래머스
- IntelliJ
- 프로젝트 생성
- valueof
- 알고리즘
- Python
- algorithm
- 문자열 숫자 변환
- 11652
- SaaS
- 웹 서버
- 최대공배수
- 유클리드 호제법
- INT
- 백준
- 2진수
- aws
- IaaS
- 11004
- 리스트
- level1
- parseInt
- java
- 짝수
- 홀수
- 데이터타입
- 온프레미스
- PaaS
Archives
- Today
- Total
Ga0Lee
[Spring Boot] HttpMediaTypeNotAcceptableException 에러 해결 본문
REST API 테스트를 하던 도중
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
이와 같은 에러가 발생했다.
@GetMapping("/post/{id}")
public MZ_BoardResponse getPost(@PathVariable Long id){
return mz_boardService.getBoard(id);
}
컨트롤러에선 아무 문제가 없어보였는데, MZ_BoardResponse 클래스에 문제가 있나 확인해보니, @Data 어노테이션을 깜빡하고 추가해주지 않았다.
@Data 말고 @Getter를 추가해줘도 위의 문제를 해결할 수 있다.
'Spring Boot' 카테고리의 다른 글
[Spring Boot] AWS S3 연결 SDK 에러 (0) | 2023.08.07 |
---|---|
[Spring Boot] AWS S3 버킷 연결 에러 (0) | 2023.08.07 |
[Spring Boot] mysql 데이터베이스 연결하기 (0) | 2023.07.30 |
[Spring Boot] MySQL Access denied for user (0) | 2023.07.06 |
[Spring Boot] Could not find com.mysql:mysql-connector-j 오류 (0) | 2023.05.29 |