springboot 7

[Springboot] Google calendar API 이용해서 공휴일 데이터 받기

일정 관리 앱을 만들어주는 프로젝트 진행 중, Google calendar API 연동 및 테스트 담당을 맡게 되었다. Google canledar API를 이용하여 공휴일 데이터를 받는 부분을 정리하고자 한다.Springboot 버전- Java 17- Springboot 3.2.0 Gradle 12345678910111213141516171819    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'    implementation 'org.springframework.boot:spring-boot-starter-security'    implementation 'org.springframework.boot:spring-boo..

Develop/SpringBoot 2023.12.17

[Springboot] Custom exception 설정하기

Springboot 개발 시, 프런트앤드로 보내주는 예외 상황에 대해서 관리하고, 예외 발생 시, 전달해주는 데이터를 통일해주기 위해 Custom exception 설정을 사용한다. 본문 글에서는 ErrorCode를 string으로 지정하였지만 편의에 따라 int로 지정해도 문제없다. Springboot 버전 - Java 17 - Springboot 3.2.0 Gradle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter..

Develop/SpringBoot 2023.12.11

[Springboot - 에러해결] ResponseEntity 한국어 데이터 깨짐

1. 에러 메시지 Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation] 2. 원인 - PaymentController 1 2 3 4 5 6 7 8 9 10 11 12 @PostMapping("/new") @ResponseBody public ResponseEntity savePayment(@RequestBody PaymentRequest paymentRequest) { log.info("Payment controller: /api/payment/new ---------------------"); // // 빌링키 발급에 실패한 경우 if (billingKey..

Error 2022.09.03

[Springboot - 에러해결]Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]

1. 에러 메시지 Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation] 2. 원인 - ContentsController 1 2 3 4 5 6 7 8 9 10 11 12 13 14 /** * content의 이미지 저장 */ @PostMapping("/new/image") public ResponseEntity saveImage(@RequestPart(required = false) MultipartFile newImage) throws IOException { log.info("Contents controller: api/contents/new/image -..

Error 2022.08.30

[Spring boot- 에러 해결] nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "SPRING_SESSION" not found; SQL statement

1. 에러 메시지 nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "SPRING_SESSION" not found; SQL statement 2. 원인 데이터베이스에 세션 저장소를 사용하기 위한 설정을 한 이후 서버를 킬 때 다음과 오류를 확인하였다. 3. 해결 1 spring.session.jdbc.initialize-schema=always // 추가 application.properties에 다음 줄을 추가해주고 다시 springboot 서버를 실행시키면 정상적으로 돌아가는 것을 확인할 수 있다. 참고 사이트 - https://velog.io/@mmy789/Spring-AWS-9

Error 2022.06.25

[Spring boot, JPA - 에러 해결] Caused by: org.hibernate.AnnotationException: Illegal attempt to map a non collection

1. 에러 메시지 Caused by: org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: 2. 원인 1 2 3 4 5 6 7 8 9 10 11 12 // User entity 부분 @OneToMany(mappedBy = "user") private Subscribe subscribe; --------------------------------------------------------------- // Subscribe entity 부분 @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(nam..

Error 2022.06.14