전체 글 790

윈도우 환경에서의 자바 설치(Feat: 쉽게 쉽게 가자!~)

[자바 설치하기] 1. 자바 17버전 설치 https://www.oracle.com/java/technologies/downloads/#java17 Download the Latest Java LTS Free Subscribe to Java SE and get the most comprehensive Java support available, with 24/7 global access to the experts. www.oracle.com - 자바 버전을 17로 깔아야 할 일이 있었기 때문에 윈도우 환경에서 이 작업을 진행해보고자 한다. - 처음 환경을 잡아줄 때 어려움이 있던 과거를 떠올리며 차근차근 해보려 한다. - 이때 JDK는 오라클의 제품이 아니어도 상관 없습니다. - MSI: Microsoft..

[Error] - Mac OS Database "C:/Users/dev/test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200] 90149/90149

[문제 상황] Database "C:/Users/dev/test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-200] 90149/90149 - h2를 테스트 환경 데이터베이스로 설정하던 도중 발생한 오류 - brew를 통한 h2 다운로드 과정에서 번거로운 과정이 생김 이를 해결하고자 h2에서 제공하는 zip 파일을 이용해서 h2 다운 받기 [문제 해결] - h2 download를 brew가 아닌 공식 홈페이지에 올라온 파일로 진행 https://herojoon-dev.tistory.com/166 Mac에서 H2 Database 설치하기 목표 Ma..

[Error] - java.lang.IllegalStateException: Specified field type [class org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager] is incompatible with resource type [jakarta.persistence.EntityManager]

[문제 상황] - java.lang.IllegalStateException: Specified field type [class org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager] is incompatible with resource type [jakarta.persistence.EntityManager] - TestPersistence를 유닛테스트에서 주입 받아 사용할 때 문제 발생 [문제 해결] - 스프링 부트 2.2버전 이후부터는 jakarta로 옮겨갔기 때문에 이와 호환해서 사용하려면 @TestEntityManager가 아닌 @EntityManager를 주입 받아 사용해야 합니다.

[Error] - java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith for test class

[문제 상황] java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith for test class - 레포지토리 유닛테스트 진행 중 마주한 예외 [문제 해결] @DataJpaTest와 @SpringbootTest 두개 애너테이션을 같이 사용하는 발생하는 예외이다. 둘 중 하나를 삭제하고 사용하면 해당 문제는 해결된다.

[Error] - 배치 서버를 시작할 때 리스너와 관련된 오류

[문제 원인] The method [onWriteError] on target class [ModifyInactiveMemberListener] is incompatible with the signature [(Exception, Chunk)] expected for the annotation [OnWriteError]. 배치 서버를 작업하던 도중 step에 등록한 리스너가 문제를 일으켰다. 이 에러 메시지는 ModifyInactiveMemberListener 클래스에 @OnWriteError 어노테이션이 붙은 onWriteError 메소드가 존재하지만, 해당 메소드의 시그니처가 @OnWriteError 어노테이션에서 기대하는 시그니처와 일치하지 않음을 나타냅니다. 해당 예외와 메소드 인자를 맞춰야 한다..

[Error] - 빈생성 중복 문제

[문제 상황] Description: The bean 'scopedTarget.listItemReader', defined in class path resource [com/yaloostore/batch/member/step/ModifyInactiveMemberStep.class], could not be registered. A bean with that name has already been defined in class path resource [com/yaloostore/batch/member/step/BirthDayCouponStep.class] and overriding is disabled. 해당 이름으로 등록된 빈이 이미 있으니까 다른 이름을 써라 ~ 하는 의미이지만 yml, propert..

[Error] - Query parameters with the following names were not documented: [_csrf] 스프링 시큐리티 환경에서 테스트 작업과 Spring rest Doc을 이용한 문서화 작업을 하면 생기는에러

[문제 상황] 스프링 시큐리티 환경에서 컨트롤러 레이어의 유닛 테스트 진행에 발생할 수 있는 문제 이 문제는 query string(=query parameter)으로 넘어오는 파라미터에 대해서 발생할 수 있는 상황인듯 싶다.(Pathvariable을 사용했을 땐 이런 일이 없었음) Query parameters with the following names were not documented: [_csrf] [시큐리티 환경에서의 컨트롤러 레이어 테스트 작업 코드] ResultActions perform = mockMvc.perform(get("/api/service/members/loginHistory").param("today", String.valueOf(today)) .with(csrf())//(1..