mzwirek
(Maciej Żwirski)
November 29, 2016, 9:11pm
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
nik9000
(Nik Everett)
November 29, 2016, 9:26pm
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?
mzwirek
(Maciej Żwirski)
November 29, 2016, 9:47pm
3
Sure, here it is:
stacktrace
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)
at com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeFieldName(UTF8JsonGenerator.java:185)
at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.writeFieldName(JsonXContentGenerator.java:187)
at org.elasticsearch.common.xcontent.XContentBuilder.field(XContentBuilder.java:244)
at org.elasticsearch.common.xcontent.XContentBuilder.startObject(XContentBuilder.java:220)
at org.elasticsearch.action.support.replication.ReplicationResponse$ShardInfo.toXContent(ReplicationResponse.java:148)
at org.elasticsearch.common.Strings.toString(Strings.java:901)
at org.elasticsearch.common.Strings.toString(Strings.java:887)
at org.elasticsearch.action.support.replication.ReplicationResponse$ShardInfo.toString(ReplicationResponse.java:165)
This file has been truncated. show original
nik9000
(Nik Everett)
November 29, 2016, 10:04pm
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.
nik9000
(Nik Everett)
November 29, 2016, 10:15pm
5
Looks like it is fixed in 5.0.1.
mzwirek
(Maciej Żwirski)
November 29, 2016, 10:28pm
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
(system)
Closed
December 27, 2016, 10:28pm
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.