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
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:
The properties class:
The yaml properties: