RemoteTransportException Failed to deserialize exception response from stream Elastic Search Java API
<p>Java Code for inserting document into elastic search</p>

<pre><code>Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("127.0.0.1", 9300));
        Map&lt;String, Object&gt; json = new HashMap&lt;String, Object&gt;();
        json.put("user","dummy");
        json.put("name","dumm");
        IndexResponse indexResponse = client.prepareIndex("myindex", "mytype").setSource(json).execute().actionGet();
        System.out.println(indexResponse.toString());  
</code></pre>

<p>Response of: <a href="http://localhost:9200/_nodes?jvm=true" rel="nofollow">http://localhost:9200/_nodes?jvm=true</a></p>

<pre><code>"pid": ​6797,
"version": "1.8.0_77",
"vm_name": "Java HotSpot(TM) 64-Bit Server VM",
"vm_version": "25.77-b03",
"vm_vendor": "Oracle Corporation",
</code></pre>

<p>Reesponse of  <a href="http://localhost:9200" rel="nofollow">http://localhost:9200</a>:</p>

<pre><code>{

    "status": ​200,
    "name": "Sin",
    "cluster_name": "elasticsearch",
    "version": 

    {
        "number": "1.6.2",
        "build_hash": "622039121e53e5f520b5ff8720fdbd3d0cb5326b",
        "build_timestamp": "2015-07-29T09:24:47Z",
        "build_snapshot": false,
        "lucene_version": "4.10.4"
    },
    "tagline": "You Know, for Search"

}
</code></pre>

<p>depedency added via maven:</p>

<pre><code> org.elasticsearch:elasticsearch:1.5.0
</code></pre>

<p>I am compiling using 1.8.0_77 to compile my source code but still getting the following exception. This type of exception occur when there is version mismatch but I don't have any</p>

<pre><code>  2016-05-06 13:33:15  INFO [http-bio-8080-exec-1] (Log4jESLogger.java:104) - [Josten, Conrad] loaded [], sites []
     2016-05-06 13:33:16  WARN [elasticsearch[Josten, Conrad][transport_client_worker][T#1]{New I/O worker #1}] (Log4jESLogger.java:114) - [Josten, Conrad] Message not fully read (response) for [0] handler future(org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler$1@52d6882a), error [true], resetting
     2016-05-06 13:33:16  INFO [http-bio-8080-exec-1] (Log4jESLogger.java:109) - [Josten, Conrad] failed to get node info for [#transport#-1][inet[/127.0.0.1:9300]], disconnecting...
     org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream
    Caused by: org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream
        at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:171)
        at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
        at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.io.InvalidClassException: failed to read class descriptor
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1603)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
        at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:169)
        ... 23 more
    Caused by: java.lang.ClassNotFoundException: org.elasticsearch.ElasticsearchException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
</code></pre>