Skip to content

Automatically generate reflection hints for configuration property binding that relies on ObjectToObjectConverter #34483

@kslex

Description

@kslex

I have built a native image with SpringBoot 3.0 and native-maven-plugin. It package successed but started failed because of throwing ConverterNotFoundException . I ran the jar, it started successfully.

Spring Boot version: 3.0.3

Error Log:

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

Description:

Failed to bind properties under 'auth.login.request-method' to org.springframework.http.HttpMethod:

    Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.springframework.http.HttpMethod]

Action:

Update your application's configuration

The properties class:

@Configuration
@ConfigurationProperties(prefix = "auth")
@Validated
@Getter
@Setter
public class BusinessProperties {

    private Login login;

    @Getter
    @Setter
    public static class Login {

        @NotBlank()
        private String requestPath;

        @NotNull()
        private HttpMethod requestMethod;
    }
}

The yaml properties:

auth:
  login:
    request-method: POST
    request-path: /login

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions