Back-End 179

[트러블 슈팅] - java.lang.NoClassDefFoundError: org/springframework/data/jdbc/repository/config/AbstractJdbcConfiguration

[문제 상황] java.lang.NoClassDefFoundError: org/springframework/data/jdbc/repository/config/AbstractJdbcConfiguration 와 관련된 문제가 발생했고 이를 해결하고자 했다. [해결 방법] - 해당 클래스가 없다는 에러로 해당 문제를 jdbc와 관련된 의존성을 주입해주면 되는 문제였다. org.springframework.boot spring-boot-starter-data-jdbc [결과] - 다른 문제가 아직 해결이 되지 않았지만 적어도 위의 뜬 NoClassDefFoundError는 해결이 된것을 확인할 수 있다.

[도커] - 도커의 bash에서 bash: vi: command not found

[문제 상황] 도커 내부에서 nginx를 이용하는데 기본 index.html 파일을 수정하려 했을 때 해당 index.html 파일을 수정하고자 한다. 그러나 이때 vi라는 명령어를 찾을 수 없다고 나오고 이를 해결하기 위해서 구글링을 했다. bash: vi: command not found [해결] apt-get install vim [해결 화면] vi index.html vi 화면이 나오는 것을 확인할 수 있다.

[오류 해결] - 이클립스에 추가한 라이브러리를 못받아오는 문제 해결

1. 문제의 시초 - 기존 이클립스를 통해서 pom.xml에 사용하고자하는 라이브러리를 추가해줬는데 이를 끌어오지 못하는 문제가 발생했다. - 이를 해결하기 위해서 계속 해당 버전의 sw jar 파일을 다운 받아서 dependency 대신 path에 설정을 잡아서 jar 파일을 넣어주는 식으로 진행했는데 더 늘어가는 라이브러리 사용에 해당 작업은 점점 어려워지기 때문에 이를 해결하고자 했다. 2. 문제의 원인 - ![](https://velog.velcdn.com/images/yeomyaloo/post/be3d5c67-8480-425d-b499-85d272cd0bef/image.png) - 이클립스에서 프로젝트를 사용할 때 깃허브와 연동해서 쓰면 라이브러리를 끌어오지 못하는 등의 문제가 발생한다고 한다...

[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..