You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue when upgrading from Spring Boot 2.4.1 to 2.4.2. I can't determine if it is an actual issue with Spring Boot or a dependency.
I have a Spring Data repository that returns an object with a Duration field which is stored in the database as a String. In Spring Boot 2.4.1 the object is created and returned successfully. After upgrading to Spring Boot 2.4.2, the following exception is thrown:
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.time.Duration]
Thanks very much for the sample. I can reproduce the problem you're seeing.
The conversion error is coming from Spring Data JDBC. Spring Boot 2.4.2 uses Spring Data BOM 2020.0.3, while Spring Boot 2.4.1 uses Spring Data 2020.0.2. Using Boot 2.4.2 while downgrading the Data version back to 2020.0.2 will reproduce the problem. You can see this by making the following change to pom.xml in the sample:
With Spring Data 2020.0.2, Spring Data JDBC is getting the expected String value of PT40M and successfully converting it to a java.time.Duration. With Spring Data 2020.0.3, Spring Data JDBC is getting INTERVAL '2400' SECOND instead, which appears to be the String representation of an org.h2.api.Interval. I can't identify a change in Spring Data JDBC that would cause this difference.
Please file an issue in Spring Data JDBC so that team can look into the issue. You can comment on this issue with a link to the Data issue for future reference.
I've encountered an issue when upgrading from Spring Boot 2.4.1 to 2.4.2. I can't determine if it is an actual issue with Spring Boot or a dependency.
I have a Spring Data repository that returns an object with a Duration field which is stored in the database as a String. In Spring Boot 2.4.1 the object is created and returned successfully. After upgrading to Spring Boot 2.4.2, the following exception is thrown:
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.time.Duration]
I've created a project that demonstrates the issue here: https://github.com/dmkeen/spring-boot-2.4.2-issue
The text was updated successfully, but these errors were encountered: