๋ฐ์ํ
Intro
์คํ๋ง์ ์ฌ์ฉํ๋ ๋์ค ๋ค์์ ์๋ฌ๊ฐ ๋ฐ์ํ์ต๋๋ค.
Parameter 0 of constructor in
kr.co.example.api.service.example.impl.ExampleApiServiceImpl
required a bean of type 'kr.co.example.common.client.aws.AwsS3Client'
that could not be found.
Why
Spring์์ ์์ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ ์ด์ ๋ AwsS3Client ๋น์ ์ฐพ์ ์ ์๊ธฐ ๋๋ฌธ์ ๋๋ค.
How to Solve
ํด๋น ํ๋ก์ ํธ์ ๊ฒฝ์ฐ ๊ฒฝ์ฐ AppConfig ํ์ผ์ ํตํด์ ์คํ๋ง ๋น์ ๋ฑ๋กํ๊ณ , ์์กด์ฑ ์ฃผ์ ์ ๊ด๋ฆฌํ๊ณ ์์ด์ AppConfig ํ์ผ์ ์์ ํด์ฃผ์์ต๋๋ค.
@Configuration
class AppConfig(
) {
@Bean
fun awsS3Client(): AwsS3Client {
return AwsS3ClientImpl()
}
}
๋ฐ์ํ