Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No converter is found when binding a non-string property via config tree #24171

Closed
making opened this issue Nov 17, 2020 · 0 comments
Closed

No converter is found when binding a non-string property via config tree #24171

making opened this issue Nov 17, 2020 · 0 comments
Assignees
Milestone

Comments

@making
Copy link
Contributor

@making making commented Nov 17, 2020

Reproducible steps with Spring Boot 2.4.0

mkdir -p /tmp/config/server/tomcat/threads 
echo 100 > /tmp/config/server/tomcat/threads/max

Configuration in application.properties

spring.config.import=configtree:/tmp/config/

Application fails to start as follows:

2020-11-17 16:47:14.546 ERROR 98427 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Failed to bind properties under 'server.tomcat.threads.max' to int:

    Property: server.tomcat.threads.max
    Value: 100
    Origin: path [/tmp/config/server/tomcat/threads/max] - 1:1
    Reason: No converter found capable of converting from type [org.springframework.boot.env.ConfigTreePropertySource$PropertyFileContent] to type [int]

Action:

Update your application's configuration

I tried other types like java.time.Duration and org.springframework.boot.actuate.autoconfigure.health.HealthProperties.Show and the results were the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants