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

Jackson throws exception when deserializing Page [DATAES-274] #849

Closed
spring-projects-issues opened this issue Jul 6, 2016 · 6 comments
Closed

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jul 6, 2016

Nikola Matkovic opened DATAES-274 and commented

When retrieving data from elasticsearch using elasticsearch repository I get the following exception:

exception:org.springframework.http.converter.HttpMessageNotWritableException - Could not write content: (was java.lang.NullPointerException) (through reference chain: org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl["facets"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl["facets"])"

Using this method in repository that extends ElasticsearchRepository
Page<EventLog> findBySeverity(String severity, Pageable pageable);

using:

  • elasticsearch client 2.3.3
  • spring-boot 1.4.0.RC1
  • spring-data-elasticsearch 2.1.0.BUILD-SNAPSHOT

Referenced from: commits a085c06

3 votes, 10 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 11, 2017

Simon Schneider commented

Did you find a solution or workaround for this? I have the same issue but with newer versions Spring Boot 1.5.1.RELEASE and elasticsearch 2.4.4

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 14, 2017

liushaofei commented

spring-boot 1.4.1.RELEASE is ok

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 7, 2017

Philipp Kräutli commented

PR #175

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 30, 2017

sreekanth commented

Due to this issue, we could not upgrade spring data stack, may i know when this is expected to be fixed ?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 28, 2017

sreekanth commented

Is it possible for a patch release for the same issue in any 2.1.x branch ?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 30, 2018

Oliver Drotbohm commented

As a general comment, Page implementations are Spring Data domain types that are not designed to be marshaled to JSON directly. Please make sure you either map them into a JSON-serializable/deserializable DTO or use Spring HATEOAS' PagedResourcesAssembler to create a PagedResource (that'll include links to the previous and/or next pages etc.)

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.