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

IllegalStateException with Projections in Spring Data Commons 3.3.3+ #3159

Closed
Banesword opened this issue Sep 20, 2024 · 1 comment
Closed
Labels
status: duplicate A duplicate of another issue

Comments

@Banesword
Copy link

We've run into an issue when we upgraded to Spring Boot 3.3.3, and it looks like it's related to the change made in Spring Data Commons 3.3.3 (431a1f5) and the issue does persist in the 3.3.4 releases.

We're started getting org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Invoked method is not a property accessor exceptions from some of our Projections. Specifically, Projections that include an abstract MappedSuperclass, which we use for common auditing fields.

The underlying exception looks to be a IllegalStateException thrown by the org.springframework.data.projection.PropertyAccessingMethodInterceptor, where it can no longer match the proper accessors from the super class.

We're using Eclipse Temurin 22.0.2 and plain Java.

Attached is a small demo project that replicates the issue (uses a small PSQL database).

We did find switching the superclass declaration from abstract to public does mitigate the issue.

projectionissue.zip

http://localhost:8080/books - error
http://localhost:8080/books/1 - no error
http://localhost:8080/books/1?projection=default - error

Thanks.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 20, 2024
@mp911de mp911de removed the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2024
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2024
@mp911de mp911de added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 2, 2024
@mp911de
Copy link
Member

mp911de commented Dec 2, 2024

Closing as duplicate of #3697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants