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
Assignees
Labels
type: bug A general bug
Milestone

Comments

@making
Copy link
Member

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 17, 2020
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 17, 2020
@snicoll snicoll added this to the 2.4.1 milestone Nov 17, 2020
@philwebb philwebb self-assigned this Nov 17, 2020
djkeh added a commit to djkeh/fastcampus-spring-boot-practice that referenced this issue Jul 12, 2021
config tree 하면 `Duration` 타입 convert 안 되는
버그 발견.
알고 보니 2.4.1 에서 패치됐다.

* spring-projects/spring-boot#24171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants