prepareDelete returns JsonGenerator error


(Maciej Żwirski) #1

Hi,

I finally had to give up. I used the following (quite straightforward) code with ES 2.3.5 client:

public static Client eSearchClient;

DeleteResponse response = RuntimeConfiguration.eSearchClient
.prepareDelete(INDEX_NAME, DOCUMENT_TYPE, String.valueOf(serviceProvider.getServiceProviderId()))
.get();

After upgrading to ES 5.0.0 (and switching to Maven) I keep getting the following exception:
"Error building toString out of XContent: com.fasterxml.jackson.core.JsonGenerationException: Can not write a field name, expecting a value
at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1886)"

My POM for ES looks like that:

org.elasticsearch
elasticsearch
5.0.0


org.elasticsearch.client
transport
5.0.0

I'd appreciate any help.

Kind regards,
Maciej


(Nik Everett) #2

I don't think we're going to be able to help much without the whole stack trace. Can you post it to a gist or something?


(Maciej Żwirski) #3

Sure, here it is:


(Nik Everett) #4

Looks like a bug. I filed

You should be able to work around it by not calling toString on the response. But we'll fix it.


(Nik Everett) #5

Looks like it is fixed in 5.0.1.


(Maciej Żwirski) #6

Yes, in 5.0.1 the problem doesn't appear. And also the work around does work for 5.0.0. Thanks a lot for the help.


(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.