Hi,

I'm currently facing this issue: When running the application 'normally' everything works fine. But if I build and deploy it as native image, the application startup fails:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method configServicePropertySource in org.springframework.cloud.config.client.ConfigServiceBootstrapConfiguration required a single bean, but 2 were found:
    - configClientProperties: defined by method 'configClientProperties' in null
    - configDataConfigClientProperties: a programmatically registered singleton

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

Version

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.0</version>
        <relativePath/>
    </parent>

...

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>2022.0.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>

Any ideas how to solve this?

Thanks, OS-JaR

Comment From: OlgaMaciaszek

Hi @OS-JaR, please provide a minimal, complete, verifiable example that reproduces the issue (preferably as a link to a GH repo with a small Spring Boot app that reproduces the issue)

Comment From: OS-JaR

Hi @OlgaMaciaszek ,

I provided a example here: Test-Me In the 'readme.md' are some instructions. If you have any further questions, feel free to ask :-)

Thanks, OS-JaR

Comment From: OlgaMaciaszek

Thanks for the sample @OS-JaR. That is by design. As indicated in the docs, Bootstrap is not supported for AOT/native.