# Is Elastic 2.2 Java Client Backward compatible?

**URL:** <https://discuss.elastic.co/t/is-elastic-2-2-java-client-backward-compatible/42427>\
**Category:** Elasticsearch\
**Created:** [February 22, 2016, 8:24pm UTC](https://discuss.elastic.co/t/is-elastic-2-2-java-client-backward-compatible/42427 "2016-02-22T20:24:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yana2301](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yana2301/32/133248_2.png) [@yana2301](https://discuss.elastic.co/u/yana2301)\
**Post date:** [February 22, 2016, 8:24pm UTC](https://discuss.elastic.co/t/is-elastic-2-2-java-client-backward-compatible/42427/1 "2016-02-22T20:24:17Z")

</div>

Hi All,  
I've upgraded to elastic 2.2 java client and got following problems when  
try to connect to Elastic 1.7:  
1.transport client doesn't start. I create transport client as:  
Settings settings = settingsBuilder()  
.put("[cluster.name](http://cluster.name)", clusterName)  
.build();  
transportClient =  
TransportClient.builder().settings(settings).build();  
stream(InetAddress.getAllByName(host))  
.forEach(address -\>  
transportClient.addTransportAddress(new  
InetSocketTransportAddress(address, port)));

client seems to be created with no errors, but I get exception when send  
request:

2016-02-22 20:16:29 DEBUG (NettyUtils.java:104) - using gathering [true]  
2016-02-22 20:16:29 DEBUG (TransportClientNodesService.java:120) - [Rock  
Python] node\_sampler\_interval[5s]  
2016-02-22 20:16:29 DEBUG (NettyInternalESLogger.java:58) - Using select  
timeout of 500  
2016-02-22 20:16:29 DEBUG (NettyInternalESLogger.java:58) - Epoll-bug  
workaround enabled = false  
2016-02-22 20:16:30 DEBUG (TransportClientNodesService.java:177) - [Rock  
Python] adding address [{#transport#-1}{10.2.2.141}{10.2.2.141:9300}]  
2016-02-22 20:16:30 DEBUG (NettyTransport.java:914) - [Rock Python]  
connected to node [{#transport#-1}{10.2.2.141}{10.2.2.141:9300}]  
2016-02-22 20:16:30 WARN (NettyTransport.java:771) - [Rock Python]  
exception caught on transport layer [[id: 0x9eba5b38, /10.10.0.4:64748 =\>  
/10.2.2.141:9300]], closing connection  
java.lang.NullPointerException  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:206)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:201)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:136)  
at  
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at  
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at  
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)  
at  
org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)  
at  
org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)  
at  
org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)  
at  
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at  
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at  
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)  
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)  
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)  
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)  
at  
org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
at  
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)  
at  
org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
at  
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at  
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)  
2016-02-22 20:16:30 DEBUG (NettyTransport.java:1078) - [Rock Python]  
disconnecting from [{#transport#-1}{10.2.2.141}{10.2.2.141:9300}], channel  
closed event

In debug status code is 3 in MessageChannelHandler.

Should I pass additional parameters or java client is not compatible with  
older versions?

1. I cannot send nested or filter, filter aggregation like this fails with  
parse error:  
"filter" : {  
"filter" : {  
"bool" : {  
"must" : {  
"nested" : {  
"query" : {  
"or" : {  
"filters" : [ {  
"term" : {  
"nested\_array.double\_full" : "125.89935"  
}  
}, {  
"term" : {  
"nested\_array.double\_full" : "466.30414"  
}  
} ]  
}  
},  
"path" : "nested\_array"  
}  
}  
}  
}  
if I change query to filter -- it works,but there is no way to build such  
query in java. If I use or query outside of nested -- it works too.  
3.I see that or and and filters are deprecated and I should use boolQuery  
instead. How can I build or filter with boolQuery?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 22, 2016, 8:40pm UTC](https://discuss.elastic.co/t/is-elastic-2-2-java-client-backward-compatible/42427/2 "2016-02-22T20:40:34Z")

</div>

No. It's not compatible.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:13pm UTC](https://discuss.elastic.co/t/is-elastic-2-2-java-client-backward-compatible/42427/4 "2017-07-05T23:13:51Z")

</div>


