ITWeb/개발일반

[Spring] bean name conflict resolve.

jjeong 2021. 11. 30. 12:17

간단하게는 명시적으로 선언을 해주시면 됩니다.

 

서로 다른 패키지에 같은 이름의 class 가 존재 할 경우 발생 할 수 있습니다.

이런 경우 아래와 같이 선언해 주시면 됩니다.

 

@RestController("cat.RestHealthController")

@Service("cat.service.HealthService")

 

@RestController("cluster.RestHealthController")

@Service("cluster.service.HealthService")