Skip to content

Unable to use projections in ItemReader #4665

Open
@jobas2007

Description

@jobas2007

While tyring to use projections in item reader, always getting "NoSuchMethodException" (for the projection method in jpa repository). Tried multiple ways, although same works when invoking via say a controller.
Error:
Caused by: java.lang.NoSuchMethodException: jdk.proxy2.$Proxy115.findDistinctByCreatedAfter(java.time.LocalDate,org.springframework.data.domain.PageRequest)
at java.base/java.lang.Class.getMethod(Class.java:2405) ~[na:na]

Env: Spring Boot 3.X, JDK 17

Created a github demo project with all set up to demonstrate issue runtime
https://github.com/jobas2007/batch-h2-demo

Expected behavior is to be able to use projection fitting into batch processing

All details are in the stackoverflow
https://stackoverflow.com/questions/79002944/purge-group-of-old-records-iteratively-to-insert-fresh-data-daily

Appreciate any help/assistance/suggestions, as been struggling for a while now. Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions