prepareDelete returns JsonGenerator error

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

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?

Sure, here it is:

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.

Looks like it is fixed in 5.0.1.

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.

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