fix(backend): Spring 6.1 RestClient bean 모호성 기동 실패 해소 #79
No reviewers
레이블
레이블 없음
마일스톤 없음
담당자 없음
참여자 2명
알림
마감일
마감일이 설정되지 않았습니다.
의존성
No dependencies set.
Reference: gc/kcg-ai-monitoring#79
불러오는 중...
Reference in New Issue
Block a user
No description provided.
Delete Branch "hotfix/backend-parameters-flag"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
증상
운영 rocky-211
kcg-ai-backend가 2026-04-17 07:33 재기동 후 다음 에러로 크래시 루프:PR #A(2026-04-17) 에서
RestClientConfig로 두 Bean 을 분리한 이후 잠복해 있던 문제로, PR #72 머지 시점부터 재기동만 안 해서 겉보기엔 정상 동작 중이었음. 오늘 릴리즈(#72/#73/#75) 이후 restart 시 발현.원인
PredictionProxyController/VesselAnalysisProxyController의 필드 에@Qualifier("predictionRestClient")가 달려있지만, Lombok@RequiredArgsConstructor가 만든 constructor parameter 에는 해당 annotation 이 복사되지 않음. Spring 6.1 이후는 parameter level annotation 으로 bean 을 식별하도록 바뀌어 모호성이 해결되지 않음.수정
backend/pom.xml—maven-compiler-plugin의default-compile/default-testCompileconfiguration 에<parameters>true</parameters>명시 추가. spring-boot-starter-parent 의 기본값이 executions override 로 덮이지 않도록 함.backend/src/main/java/lombok.config(신규) —lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier. Lombok 이 필드의@Qualifier를 생성된 constructor parameter 에 복사해 Spring 이 해당 bean 을 식별 가능하게 함.검증
javap -v PredictionProxyController.class에서 생성자의RuntimeVisibleParameterAnnotations에@Qualifier("predictionRestClient")복사 확인Started KcgAiApplication in 7.333 seconds+Tomcat started on port 18080 (http)정상 기동배포 상태
이미 운영 jar 에 수정 반영 완료. 이 PR 은 소스 추적 동기화 목적.
증상: rocky-211 의 kcg-ai-backend 가 `No qualifying bean of type RestClient, but 2 were found: predictionRestClient, signalBatchRestClient` 로 기동 실패 반복. PR #A 의 RestClientConfig 도입 이후 잠복해 있던 문제로, PredictionProxyController / VesselAnalysisProxyController 의 필드 @Qualifier 가 Lombok `@RequiredArgsConstructor` 가 만든 constructor parameter 로 복사되지 않아 Spring 6.1 의 bean 이름 fallback 이 실패한 것. - backend/pom.xml — default-compile / default-testCompile 의 configuration 에 `<parameters>true</parameters>` 추가. spring-boot-starter-parent 기본값을 executions override 과정에서 덮어쓰지 않도록 명시. - backend/src/main/java/lombok.config — `lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier`. Lombok 이 필드의 @Qualifier 를 생성된 constructor parameter 로 복사해야 Spring 이 파라미터 레벨 annotation 으로 해당 bean 을 식별할 수 있음. 검증: javap 로 PredictionProxyController 생성자의 RuntimeVisibleParameterAnnotations 에 @Qualifier("predictionRestClient") 가 실제 복사되었는지 확인, 재빌드/재배포 후 rocky-211 기동 성공("Started KcgAiApplication in 7.333 seconds") + Tomcat 18080 정상 리스닝.운영 복구 hotfix 승인 (via /release follow-up)