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

Application yaml file is not processed after spring boot migration #35403

Closed
ovidiupopa07 opened this issue May 12, 2023 · 2 comments
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@ovidiupopa07
Copy link

Hello. Last week we migrated our projects from spring boot 2.3.12.RELEASE to spring boot 2.7.11 and after that our projects are not starting anymore with the following exception :

Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.util.LinkedHashMap<?, ?>] to type

This happens for entries that are defined as empty objects in the YML file. I attached a sample project

demo.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 12, 2023
@wilkinsona wilkinsona self-assigned this May 12, 2023
@wilkinsona
Copy link
Member

wilkinsona commented May 12, 2023

The change in behavior is due to #21704 which has affected the behavior of YamlProcessor's building of the flattened map.

Prior to #21704, the value of person.address was an empty map which the flattening process dropped completely. With the change for #21704 in place, the value of person.address is an OriginTrackedValue that wraps the empty map. This wrapper isn't an instance of String, Map, or Collection so it's added as-is to the result map.

My memory about #21704 is quite hazy but the change appears to contradict our decision to decline #19095. I'm not sure if we changed our minds on #19095 or overlooked an implication of #21704. We'll discuss this one as a team and figure out what to do. In the meantime, hopefully you can remove the empty map from your YAML. This will restore Spring Boot 2.3's behavior which was ignoring it anyway.

@wilkinsona wilkinsona added the for: team-meeting An issue we'd like to discuss as a team to make progress label May 12, 2023
@philwebb philwebb self-assigned this May 24, 2023
@philwebb
Copy link
Member

After some consideration I think we should revert #21704. I don't think we should be adding Collection types to the PropertySource. Following the trail, it seems like #21704 was a fix for #20506 which was driven by spring-cloud/spring-cloud-config#1572. That Spring Cloud issue was fixed by spring-cloud/spring-cloud-config@0771829.

@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels May 24, 2023
@philwebb philwebb added this to the 2.7.x milestone May 24, 2023
@philwebb philwebb modified the milestones: 2.7.x, 3.3.x Nov 8, 2023
@philwebb philwebb modified the milestones: 3.3.x, 3.4.x May 22, 2024
@philwebb philwebb modified the milestones: 3.4.x, 3.5.x Jun 17, 2024
@wilkinsona wilkinsona modified the milestones: 3.4.x, 3.4.0-M3 Sep 10, 2024
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