Closed jloisel closed 9 months ago
I narrowed down the issue to the Spring Framework dependency. It works with Spring 6.0.14
, but fails with Spring 6.1.1
.
I don't know if it makes any difference but the maven compiler plugin differs a bit from what we're recommending - do you still get the same issue with this configuration?
Could you share a minimal sample application that reproduces the problem? I'll transfer this issue to Spring Framework in the meantime.
I tried with:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<release>${java.release.version}</release>
<parameters>true</parameters>
</configuration>
</plugin>
Still the same issue. But, i'll keep the new syntax over the old one :)
Unfortunately, I don't have any minimal sample application. I'm checking if I can do that in a reasonable timeframe.
Here is a sample project which reproduces the issue:
Simply run the unit test, and it fails with a classcast exception like shown above.
This might be related to one of the latest binding issues we fixed here in Spring Framework. I've upgraded your sample to Spring Boot 3.2.1-SNAPSHOT and it works fine. Can you check with your actual application?
Glad it fixed the issue :)
I tried the snapshot maven repository but it's apparently not being able to pull spring snapshots:
<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</repository>
</repositories>
If you know how I can retrieve Spring Snapshots, let me know.
Maybe this?
<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
Artifacts are present: https://repo.spring.io/snapshot/org/springframework/spring-core/6.1.2-SNAPSHOT/
I'm closing this issue for now, we will reopen if it turns out this is not completely fixed in SNAPSHOTs.
Thanks!
We are facing an issue when upgrading to Spring Boot 3.2.0. We are currently using:
3.1.5
,2.15.3
,Code is compiled using Maven with "-parameters" enabled:
When upgrading from Spring Boot 3.1.x to 3.2.0, the following controller method stops working properly:
The ValueWrapper bean is pretty simple:
UserCounterValue uses polymorphism with json "@type" field:
And both concrete beans implementing this interface are declared in Jackson using
mapper.registerSubTypes(...)
.When running a junit which uses Retrofit to send the bean to the backend, it fails:
When debugging the issue, we can see that the
UserCounterValue
is not being deserialized properly:When running the same test using Spring Boot 3.1.x:
In this case, we can see that the nested bean is deserialized properly using Jackson.