Skip to content

@ConfigurationProperties constructor binding not working in 2.2.0.RC1 #18543

@dldiehl77

Description

@dldiehl77

I created a very, very simple project to test out configuration properties constructor binding. It sure doesn't seem to work at all. I've attached a zip file with the little project.

I also created this on stackoverflow but didn't get much help there: https://stackoverflow.com/questions/58259065/configurationproperties-constructor-binding-not-working-in-2-2-0-rc1

In the attached project, if I remove the "final" keyword on the "stuff" field, uncomment the setter method, and comment out the single argument constructor, the project runs fine (the application starts and the framework calls the setter). I've also tried commenting out the @configuration annotation but that made no difference.

Anyway, when the application starts it fails with this error:

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

Description:

Parameter 0 of constructor in com.acme.AppConfig required a bean of type 'java.lang.String' that could not be found.


Action:

Consider defining a bean of type 'java.lang.String' in your configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions