Trouble Shooting

·Trouble Shooting
오류상황회원가입 API 테스트 도중 해당 로직에서 문제가 발생하였다. @Override@Transactionalpublic UserInfo registerUser(UserCommand command) { Users initUser = command.toEntity(policy); Users user = userStore.store(initUser); return new UserInfo(user);}org.springframework.dao.DataIntegrityViolationException: could not execute statement [Data truncation: Data too long for column 'phone_number' at row 1] [insert into..
·Trouble Shooting
개인 프로젝트를 시작하면서 Spring Security와 JWT를 이용해 회원가입 및 로그인 기능을 구현하고 있다. JWT 생성 로직을 구현하고 테스트하는 과정에서 발견한 에러를 공유해본다. 해당 예러는 로그인 테스트 진행 중 발생하였다. io.jsonwebtoken.security.WeakKeyException: The specified key byte array is 120 bits which is not secure enough for any JWT HMAC-SHA algorithm. The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HMAC-SHA algorithms MUST have a size >= 256..
·Trouble Shooting
발생컨트롤러 테스트를 위해 `@WebMvcTest` 선언 후 테스트 코드를 실행했을 때 발생하였다. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaAuditingHandler': Cannot resolve reference to bean 'jpaMappingContext' while setting constructor argument at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:377) at o..
·Trouble Shooting
.gitignore가 정상적으로 작동하지 않는 이유와 해결 방법.gitignore는 Git에서 특정 파일이나 디렉터리를 추적하지 않도록 설정하는 중요한 도구입니다. 그러나 .gitignore가 제대로 작동하지 않을 때는 다음과 같은 이유가 있을 수 있습니다. Git 캐시를 초기화이런 경우는 대부분 프로젝트를 신규로 만들거나 할때 발생되는데 Git 캐시를 초기화해주면 정상적으로 작동하는 것을 알수 있다. 해결 방법1. 모든 추적된 파일을 캐시를 초기화한다.git rm -r --cached . 이 명령은 모든 파일을 Git의 캐시에서 제거하지만, 실제 파일은 로컬에 남아 있습니다. 2. .gitignore를 적용한 후 변경 사항 추가 git add . 3. 변경 사항 커밋git commit -m "Reapp..
·Trouble Shooting
개요 자바과제를 진행하다 Scanner 입력값에 대한 예외처리를 위해 try catch문을 사용했는데 무한 루프에 빠지게 되었다. 문제 발생 코드 public static void main(String[] args) { startMenu(); Scanner sc = new Scanner(System.in); while (true) { try { int target = sc.nextInt(); if (target == 1) { System.out.println("회원 관리 메뉴를 선택하였습니다."); } else if (target == 2) { System.out.println("과목 관리 메뉴를 선택했습니다."); } else if (target == 3) { System.out.println("수강 ..
·Trouble Shooting
발생 배경 Windows 환경에서 도커를 사용하기 위해 WSL을 이용해 Ubuntu 배포버전을 설치하다가 발생한 이슈이다. 이슈 상황 WSL 설정까지는 잘되다가 Ubuntu를 설치하는 과정에서 문제가 발생하였다. 아래 이미지와 같이 0x80370102 에러가 발생되었다. 에러의 설명을 잘 살펴보면 원도우 환경에 가상머신 플랫폼을 사용하기 위해선 virtualiztion(가상화)을 enabled로 변경해줘야 한다고 나와있다. 자세한 건 주어진 홈페이지를 확인해보면 된다. (https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#error-0x80370102-the-virtual-machine-could-not-be-started-because-a-re..
·Trouble Shooting
이슈상황 Github에 repository를 생성할 때 readme를 같이 생성. 원격저장소를 remote로 연결하여 내 로컬에 있는 프로젝트를 원격 저장소로 push 할 때 이슈 발생. [error: failed to push some refs to] 오류가 발생 원인을 확인해 보니 원격저장소에는 Readme 파일이 있는데 로컬에는 없을 경우 발생된다고 한다. 해결 방안 1. 강제로 push 하기 제일 간단한 방법이지만 원격저장소의 파일이 훼손될 수 있다. 아직 원격저장소에 특별한 작업이 없다면 이 방법을 추천한다. 만약 원격저장소 Readme 등을 작업하고 있으면 백업 후 진행하거나 아래 방식을 이용한다.(다 날아감) git push origin +main 2. git pull (권장 방법) 해당 오..
·Trouble Shooting
넘블/딥다이브 [방문자 수 트래킹 서비스 구축하기] 프로젝트 진행 중 이슈에 대한 트러블 슈팅과정입니다. 이슈 전 프로젝트 상황 설명 [Spring Boot + JPA + MySQL] 기반 프로젝트이다. 방문자 수 트래킹을 기록하기 위한 테이블 구성은 아래와 같이 구성하였고 일자별 특정 URL에 대한 방문 조회수를 기록하는 형태이다. @Entity public class UrlCounter { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 200) private String url; @Column(nullable = false) private LocalDate..
·Trouble Shooting
이슈발생 Swagger 설정 강의를 듣다가 에러가 발생하여 정리한다. Spring Boot 2.7.8 버전과 Swagger 2.9.2 버전 사용하였고 다음과 같은 에러가 발생하였다. Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 해당 에러는 Spring Boot 2.6 버전 이후에 발생된다. spring.mvc.pathmatch.matching-strategy의 default 값이 ant_path_matcher -> path_pattern_parser로 변경되어 특정 라이브러리에서 발생이 된다. 해결방법 application.properties에 아래의 내용을..
·Trouble Shooting
Intellij의 Spring Initializr로 Spring Boot 프로젝트를 생성 중 해당 이슈가 발생하였다. 이슈발행 Plugin 'org.springframework.boog:spring-boot-maven-plugin:' not found 해당 오류 Maven plugin의 버전이 명시가 되지 않아서 나는 에러이다. 문제 해결 문제 해결 방법에 대해 2가지 방법을 제시한다. 첫 번째 방법 Maven Dependency 폴더인. m2 삭제 후 재시작하는 방법이다. 이 방법은 Dependency '디펜던시명' not found 발생 했을때 가장 많이 사용된다. 1. 캐시삭제 / IDE 재시작 File -> Invalidate Caches / Restart... (캐시 무효화) -> Invalid..
JH_DEV77
'Trouble Shooting' 카테고리의 글 목록