본문 바로가기

🛠 BackEnd8

[InaccessibleObjectException 오류] java.time.LocalDateTime.date accessible: module java.base does not "opens java.time" to unnamed module 😈 ErrorResolved [java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.time.LocalDate java.time.LocalDateTime.date accessible: module java.base does not "opens java.time" to unnamed module    🔒 InaccessibleObjectException 오류 원인 ava 16 이후로 모듈 시스템의 강화된 접근 제어로 인해 발생하는 문제이다. 특히, JSON 직렬화/역직렬화 라이브러리(Gson, Jackson 등)가 LocalDateTime 같은 Java 시간 API 클래스를 처리할 때 자주 발생한다. .. 2024. 9. 9.
[ Spring ] Spring Batch 이해와 도메인 용어 📌 배치(Batch) 프로그램의 흐름에 따라 순차적으로 자료를 처리한다는 뜻 배치 처리 = 일괄 처리 배치작업: 사용자가 개입하지 않는 환경에서 특정 완료 시점까지 실행되는것 ex) 은행 점검시간, 월말정산 처리 등 배치애플리케이션을 구현: 하나의 애플리케이션에서 수행하면 성능 저하를 유발할 수 있음 Spring Batch 🍃 💡 엔터프라이즈 시스템의 운영에 있어 대용량 일괄처리의 편의를 위해 설계된 가볍고 포괄적인 배치 프레임워크 Spring의 틀성을 그대로 가져왔기 때문에 DI, AOP, 서비스 추상화 등 Spring프레임워크의 3대요소를 모두 사용 가능 로깅/투적, 트랜잭션 관리, 작업 처리 통계, 작업 재시작, 건너뛰기, 리소스 관리 등 대용량 레코드 처리에 필수적인 재사용 가능한 기능을 제공 또.. 2022. 12. 3.
[ Spring ] Table 'batch.batch_job_instance' doesn't exist / 에러 해결방법 (SpringBoot 2.5 이상) 🍃 spring boot-version '2.7.5' 🌎 java-version 11 🐘 gradle 🐬 (DB) MySQL ✍ Spring Batch를 구현하기위해 간단한 테스트 도중 에러를 맞닥뜨렸다 Failed to execute ApplicationRunner 에러 중 ▶ Table 'batch.batch_job_instance' doesn't exist 😈 Error java.lang.IllegalStateException: Failed to execute ApplicationRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:765) ~[spring-boot-2.7.5.jar:2.7.5] a.. 2022. 11. 30.
[ Spring ] @Scheduled 스케줄러 사용법 💻 SchedulerConfig.class import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.SchedulingConfigurer; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.scheduling.config.ScheduledTaskRegistrar; // [Configuration 어노테이션 : 자바 클래스 파일을 설정 파일로 사용] @Configuration public class SchedulerConfig impleme.. 2022. 11. 2.
[ Spring ] - Spring Security 인증 절차 인터페이스 UserDetails, UserDetailsService UserDetailsService 해당 인터페이스의 메소드에서 DB의 유저 정보를 가져와서 AuthenticationProvider 인터페이스로 유저 정보를 리턴하면, 그 곳에서 사용자가 입력한 정보와 DB에 있는 유저 정보를 비교한다. 해당 글은 유저 정보를 가져오는 인터페이스를 구현하는 것이기 때문에, 사용자가 입력한 정보와 비교하는 작없은 없다. DB에서 유저 종보를 가져오는 작업만 하기 때문에, 여기서 필요한 인터페이스는 UserDetails 인터페이스와 UserDetailsService 인터페이스다. 1. UserDetails 💡 사용자 정보를 담는 인터페이스 Spring Security에서 사용자의 정보를 담는 인터페이스는 UserDetails 인터페이스이다. 이 인터페이스를 구현하게 되면 S.. 2022. 10. 9.
[ Spring ] Controller, Service Repository 코드 분리 (2/2) 📌 Controller, Service Repository 역할 - 전체적인 흐름 💻 AllInOneController ⇨ ProductController 로 변경 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 29 30 31 32 33 34 35 36 37 38 39 40 import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import java.sql.SQLException; import java.util.List; @RequiredArgsConstructor // final로 선언된 멤버 변수를 자동으로 생성.. 2022. 10. 8.