From f07d68b43f5c502c59f8796f007a8176b2beb88d Mon Sep 17 00:00:00 2001 From: htlee Date: Fri, 17 Apr 2026 07:40:57 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20Spring=206.1=20RestClient=20bea?= =?UTF-8?q?n=20=EB=AA=A8=ED=98=B8=EC=84=B1=20=EA=B8=B0=EB=8F=99=20?= =?UTF-8?q?=EC=8B=A4=ED=8C=A8=20=ED=95=B4=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 증상: 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 에 `true` 추가. 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 정상 리스닝. --- backend/pom.xml | 2 ++ backend/src/main/java/lombok.config | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 backend/src/main/java/lombok.config diff --git a/backend/pom.xml b/backend/pom.xml index 7384f52..3c8b0ae 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -142,6 +142,7 @@ compile + true org.springframework.boot @@ -161,6 +162,7 @@ testCompile + true org.projectlombok diff --git a/backend/src/main/java/lombok.config b/backend/src/main/java/lombok.config new file mode 100644 index 0000000..8022e7c --- /dev/null +++ b/backend/src/main/java/lombok.config @@ -0,0 +1,6 @@ +config.stopBubbling = true + +# @RequiredArgsConstructor 가 생성하는 constructor parameter 에 필드의 @Qualifier 를 복사한다. +# Spring 6.1+ 의 bean 이름 기반 fallback 은 parameter-level annotation 을 요구하므로, +# 필수 처리하지 않으면 여러 bean 중 모호성이 발생해 기동이 실패한다. +lombok.copyableAnnotations += org.springframework.beans.factory.annotation.Qualifier