# Elasticsearch java update api error

**URL:** https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989
**Category:** Elasticsearch
**Created:** [September 28, 2014, 3:14am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989 "2014-09-28T03:14:44Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![zouxcs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zouxcs/32/920_2.png) [@zouxcs](https://discuss.elastic.co/u/zouxcs)
#### Post date: [September 28, 2014, 3:14am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/1 "2014-09-28T03:14:44Z")

</div>

I use script to partial update my doucument by java.  
here is the java code;

bulkRequest.add(client.prepareUpdate(indexName, indexTypeName,key).setScriptLang(updateScriptLang.toString()));

and my elasticsearch version is 0.90.1 and the java version is jdk\_1.6.0\_20

Here is the error:  
org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream  
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:168)  
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:122)  
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
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:310)  
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)  
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:724)  
Caused by: java.io.EOFException  
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)  
at java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1942)  
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1916)  
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
at java.io.ObjectInputStream.access$300(ObjectInputStream.java:206)  
at java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2151)  
at java.io.ObjectInputStream.readFields(ObjectInputStream.java:538)  
at java.net.InetSocketAddress.readObject(InetSocketAddress.java:282)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:606)  
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)  
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)  
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)  
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)  
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)  
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)  
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)  
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:166)  
... 23 more

---

<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: [September 28, 2014, 5:44am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/2 "2014-09-28T05:44:53Z")

</div>

Are you mixing client and nodes version?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 28 sept. 2014 à 05:14, zouxcs [zouxcs@gmail.com](mailto:zouxcs@gmail.com) a écrit :
> 
> I use script to partial update my doucument by java.  
> here is the java code;
> 
> bulkRequest.add(client.prepareUpdate(indexName,  
> indexTypeName,key).setScriptLang(updateScriptLang.toString()));
> 
> and my elasticsearch version is 0.90.1 and the java version is jdk\_1.6.0\_20
> 
> Here is the error:  
> org.elasticsearch.transport.TransportSerializationException: Failed to  
> deserialize exception response from stream  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:168)  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:122)  
> at  
> org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)  
> 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:310)  
> at  
> org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)  
> 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:724)  
> Caused by: java.io.EOFException  
> at  
> java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)  
> at  
> java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1942)  
> at  
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1916)  
> at  
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
> at  
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
> at java.io.ObjectInputStream.access$300(ObjectInputStream.java:206)  
> at  
> java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2151)  
> at java.io.ObjectInputStream.readFields(ObjectInputStream.java:538)  
> at java.net.InetSocketAddress.readObject(InetSocketAddress.java:282)  
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> at  
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
> at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> at java.lang.reflect.Method.invoke(Method.java:606)  
> at  
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)  
> at  
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)  
> at  
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
> at  
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
> at  
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)  
> at  
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)  
> at  
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
> at  
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
> at  
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)  
> at  
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)  
> at  
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)  
> at  
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)  
> at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)  
> at  
> org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:166)  
> ... 23 more
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139.html](http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1411874084381-4064139.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1411874084381-4064139.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4C2E7F31-E5B6-43D0-947E-9207D7058FDA%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/4C2E7F31-E5B6-43D0-947E-9207D7058FDA%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![zouxcs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zouxcs/32/920_2.png) [@zouxcs](https://discuss.elastic.co/u/zouxcs)
#### Post date: [September 28, 2014, 5:48am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/3 "2014-09-28T05:48:29Z")

</div>

The client and the node are both version 0.90.1

---

<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: [September 28, 2014, 5:53am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/4 "2014-09-28T05:53:43Z")

</div>

Strange.

That said, you did not set the script itself, right?

Also 0.90.1 is really old. Your Jvm as well.  
You should upgrade.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 28 sept. 2014 à 07:48, zouxcs [zouxcs@gmail.com](mailto:zouxcs@gmail.com) a écrit :
> 
> The client and the node are both version 0.90.1
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064143.html](http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064143.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1411883310287-4064143.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1411883310287-4064143.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4558174D-031A-4070-A8F8-855E1C26614F%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/4558174D-031A-4070-A8F8-855E1C26614F%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![zouxcs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zouxcs/32/920_2.png) [@zouxcs](https://discuss.elastic.co/u/zouxcs)
#### Post date: [September 28, 2014, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/5 "2014-09-28T05:57:48Z")

</div>

I set the script manually,the updateScriptLang is like  
"ctx.\_source.field1=""+string+"";ctx.\_source.field2="+Integer+";"

---

<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: [September 28, 2014, 7:58am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/6 "2014-09-28T07:58:05Z")

</div>

I might be wrong but from the top of my head, setScriptLang is used to set the script language such as mvel, groovy,...

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 28 sept. 2014 à 07:57, zouxcs [zouxcs@gmail.com](mailto:zouxcs@gmail.com) a écrit :
> 
> I set the script manually,the updateScriptLang is like  
> "ctx.\_source.field1=""+string+"";ctx.\_source.field2="+Integer+";"
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064146.html](http://elasticsearch-users.115913.n3.nabble.com/elasticsearch-java-update-api-error-tp4064139p4064146.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1411883868225-4064146.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1411883868225-4064146.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/F45523B7-0907-4C3D-9170-ADD9D4878BF8%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/F45523B7-0907-4C3D-9170-ADD9D4878BF8%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![zouxcs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zouxcs/32/920_2.png) [@zouxcs](https://discuss.elastic.co/u/zouxcs)
#### Post date: [September 28, 2014, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/7 "2014-09-28T08:14:40Z")

</div>

Yeah,that's right,I changed to setScript and it works,thank you for the help.

---

<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 6, 2017, 12:59am UTC](https://discuss.elastic.co/t/elasticsearch-java-update-api-error/19989/8 "2017-07-06T00:59:33Z")

</div>


