Hello, we initialize a bean via ConfigurationProperties:

@Bean
@Lazy
@ConfigurationProperties("custom.application")
ConfigFactoryBean configFactory() {
    return new ConfigFactoryBean();
}

The bean (external lib) implements the FactoryBean class and overrides its methods:

public class ConfigFactoryBean extends ConfigBuilder implements FactoryBean<Config> {

    @Override
    public Config getObject() throws Exception {
        return build();
    }

    @Override
    public Class<?> getObjectType() {
        return Config.class;
    }

    public String getSecurityConfig() {
        return getSecurityConfigValue();
    }

    public ConfigFactoryBean setSecurityConfig(final String securityConfigValue) {
        setSecurityConfigValue(securityConfigValue);
        return this;
    } ...

Since the SpringBoot3 update we receive the following error message:

Error creating bean with name 'configFactory': Could not bind properties to 'ConfigFactoryBean' : prefix=custom.application, ignoreInvalidFields=false, ignoreUnknownFields=true

Failed to bind properties under 'custom.application.object' to com.example.external.Config:
Reason: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'custom.application.object' to com.example.external.Config

This error did not occur with Spring Boot 2.x.

In debug mode, I was able to analyze that it is due to the FactoryBean method "getObject()" that we are overriding.

In SpringBoot 2, no binding was performed for this method and it was skipped because there was no suitable property for it in the application.properites (Method "hasKnownBindableProperties" in JavaBeanBinder.class).

With SpringBoot3, an attempt is made to perform a binding for "getObject()", which leads to the error described above.

What has changed at this point or why is the binding not still skipped if there is no suitable property? What do we have to change during initialization in SpringBoot3?

Thank you very much and best regards Oliver

Comment From: wilkinsona

We've seen a similar problem recently due to a non-enumerable property source. It was a new problem introduced during the development of Spring Boot 3.2 and was fixed in 3.2.0. You haven't said what version you're using but I suspect it's unlikely that you have the exact same problem.

If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: Oli411

Hi @wilkinsona, thanks for the quick reply. The problem exists for all 3.x versions (I have tested all of them, including 3.2.0). I can share a minimal sample with you, but I need some preparation time and will get back to you.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.