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

Problem deserializing a class with ancestors. #4

Open
danjee opened this issue Apr 5, 2023 · 0 comments
Open

Problem deserializing a class with ancestors. #4

danjee opened this issue Apr 5, 2023 · 0 comments

Comments

@danjee
Copy link

danjee commented Apr 5, 2023

Issue deserializing a spring data PageImpl.
I've excluded the legacy afterburner from my dependencies and a deserializer started failing.
My custom class is extending PageImpl which extends Chunk.

@JsonIgnoreProperties(ignoreUnknown = true, value = {"pageable"})
public class RestPage<T> extends PageImpl<T> {

    private static final long serialVersionUID = 851236798223548446L;

    @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
    public RestPage(
            @JsonProperty("content") final List<T> content,
            @JsonProperty("page") final int page,
            @JsonProperty("size") final int size,
            @JsonProperty("totalElements") final long total) {
        super(content, PageRequest.of(page, size), total);
    }

    public RestPage(final Page<T> page) {
        super(page.getContent(), page.getPageable(), page.getTotalElements());
    }
}

The error I get is: java.lang.IllegalAccessException: class is not public: org.springframework.data.domain.Chunk.getContent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant