# Java.lang.ArrayIndexOutOfBoundsException 0?

**URL:** <https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993>\
**Category:** Elasticsearch\
**Created:** [March 4, 2013, 11:27am UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993 "2013-03-04T11:27:22Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jingang\_Wang](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jingang\_Wang](https://discuss.elastic.co/u/Jingang_Wang)\
**Post date:** [March 5, 2013, 10:09am UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993/21 "2013-03-05T10:09:42Z")

</div>

Hi Jörg,

I have run the code successfully after I deleted the old ES version in  
another machine.  
What's the reason to this error even the ES in another machine is not  
initialized?  
Thanks for your time so much!!!

On Tue, Mar 5, 2013 at 6:05 PM, Jingang Wang [bitwjg@gmail.com](mailto:bitwjg@gmail.com) wrote:

> I ever used ES 0.12 and now 0.90.  
> In my current machine, I run ES 0.90, I have not replace the old ES  
> version, but the ES instance in that machine is not initialized now.  
> would it be affected?
> 
> On Tue, Mar 5, 2013 at 5:59 PM, Jörg Prante [joergprante@gmail.com](mailto:joergprante@gmail.com) wrote:
> 
> > This error is mainly caused by mixing different ES versions, are you sure  
> > you use only one ES version in the running nodes, on the local network?
> > 
> > Jörg
> > 
> > Am 05.03.13 10:53, schrieb Jingang Wang:
> > 
> > Thanks, but there occurs another exception. I think there should be some
> > 
> > > mistakes in my settings of ES?
> > > 
> > > Exception in thread "main" org.elasticsearch.transport.\*\*  
> > > TransportSerializationExceptio\*\*n: Failed to deserialize exception  
> > > response from stream  
> > > at org.elasticsearch.transport. **netty.MessageChannelHandler.**  
> > > handlerResponseError(\*\*MessageChannelHandler.java:\*\*171)
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)\*\*  
> > topic/elasticsearch/\*\*l63cThzXKvI/unsubscribe?hl=en-\*\*US[https://groups.google.com/d/topic/elasticsearch/l63cThzXKvI/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/l63cThzXKvI/unsubscribe?hl=en-US)  
> > .  
> > To unsubscribe from this group and all its topics, send an email to  
> > elasticsearch+unsubscribe@\*\*[googlegroups.com](http://googlegroups.com)[elasticsearch%2Bunsubscribe@googlegroups.com](mailto:elasticsearch%2Bunsubscribe@googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > .
> 
> --  
> Wang Jingang(王金刚)  
> Ph.D Candidate at  
> Lab of High Volume Language Information Processing & Cloud Computing  
> School of Computer Science  
> Beijing Institute of Technology  
> Beijing 100081  
> P.R China

--  
Wang Jingang(王金刚)  
Ph.D Candidate at  
Lab of High Volume Language Information Processing & Cloud Computing  
School of Computer Science  
Beijing Institute of Technology  
Beijing 100081  
P.R China

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 5, 2013, 11:25am UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993/22 "2013-03-05T11:25:02Z")

</div>

I think there was another node up and running. You can check this by  
looking at the hosts on the network. At ports 9300..9400, if ports are  
open for listening, you can be sure there is an ES node active.

The EOFException is somehow unexpected when versions are mixed. But,  
since the internal ES data structures change in a new version, they grow  
in length. So if an old ES version responds with a short answer, the new  
ES node waits for a longer version. But on the network layer, the  
connection closes, and the new ES node gets notified with an EOFException.

For the future, Elasticsearch send magical version headers in all the  
data transports which allow to detect the version of ES nodes which is  
currently being talked to. So, new ES versions can deny data transport  
more gracefully with a nice hint, and no more low level network  
expections will happen.

Jörg

Am 05.03.13 11:09, schrieb Jingang Wang:

> I have run the code successfully after I deleted the old ES version in  
> another machine.  
> What's the reason to this error even the ES in another machine is not  
> initialized?  
> Thanks for your time so much!!!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jingang\_Wang](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jingang\_Wang](https://discuss.elastic.co/u/Jingang_Wang)\
**Post date:** [March 5, 2013, 11:37am UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993/23 "2013-03-05T11:37:16Z")

</div>

Thanks for your explanation.  
Your demo code shows how to create index and query meanwhile after refresh.  
What should I do if I want I create an Index with it active, and query it  
when I need, because I need to add some documents into the index  
ceaselessly.  
Besides, I still do not find the error in my early code. ☹

On Tue, Mar 5, 2013 at 7:25 PM, Jörg Prante [joergprante@gmail.com](mailto:joergprante@gmail.com) wrote:

> I think there was another node up and running. You can check this by  
> looking at the hosts on the network. At ports 9300..9400, if ports are open  
> for listening, you can be sure there is an ES node active.
> 
> The EOFException is somehow unexpected when versions are mixed. But, since  
> the internal ES data structures change in a new version, they grow in  
> length. So if an old ES version responds with a short answer, the new ES  
> node waits for a longer version. But on the network layer, the connection  
> closes, and the new ES node gets notified with an EOFException.
> 
> For the future, Elasticsearch send magical version headers in all the data  
> transports which allow to detect the version of ES nodes which is currently  
> being talked to. So, new ES versions can deny data transport more  
> gracefully with a nice hint, and no more low level network expections will  
> happen.
> 
> Jörg
> 
> Am 05.03.13 11:09, schrieb Jingang Wang:
> 
> I have run the code successfully after I deleted the old ES version in
> 
> > another machine.  
> > What's the reason to this error even the ES in another machine is not  
> > initialized?  
> > Thanks for your time so much!!!
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)\*\*  
> topic/elasticsearch/\*\*l63cThzXKvI/unsubscribe?hl=en-\*\*US[https://groups.google.com/d/topic/elasticsearch/l63cThzXKvI/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/l63cThzXKvI/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> elasticsearch+unsubscribe@\*\*[googlegroups.com](http://googlegroups.com)[elasticsearch%2Bunsubscribe@googlegroups.com](mailto:elasticsearch%2Bunsubscribe@googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> .

--  
Wang Jingang(王金刚)  
Ph.D Candidate at  
Lab of High Volume Language Information Processing & Cloud Computing  
School of Computer Science  
Beijing Institute of Technology  
Beijing 100081  
P.R China

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [March 5, 2013, 12:36pm UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993/24 "2013-03-05T12:36:15Z")

</div>

Just put the query part elsewhere. You can consider using a river for  
your indexing routine. A river is nothing but a plugin with a client  
that fetches data from a source, and enters a loop for indexing data  
contineously, e.g. from a file, a database, or a stream data source.

Jörg

Am 05.03.13 12:37, schrieb Jingang Wang:

> What should I do if I want I create an Index with it active, and query  
> it when I need, because I need to add some documents into the index  
> ceaselessly.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jingang\_Wang](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jingang\_Wang](https://discuss.elastic.co/u/Jingang_Wang)\
**Post date:** [March 6, 2013, 3:40am UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993/25 "2013-03-06T03:40:43Z")

</div>

Hi Jörg and David,

I have resolved this problem, it was caused by different versions.  
Because I ever used ES 0.20 before, so I referenced the jars in ES 0.20 in  
my project. However, I forgot to re-reference these jars in my project  
after I changed ES from 0.20 to 0.90.  
The program could work after I resolved it.  
I would express my sincerest thanks to both of your for your times and  
great help.

Best,  
Jingang

On Tue, Mar 5, 2013 at 8:36 PM, Jörg Prante [joergprante@gmail.com](mailto:joergprante@gmail.com) wrote:

> Just put the query part elsewhere. You can consider using a river for your  
> indexing routine. A river is nothing but a plugin with a client that  
> fetches data from a source, and enters a loop for indexing data  
> contineously, e.g. from a file, a database, or a stream data source.
> 
> Jörg
> 
> Am 05.03.13 12:37, schrieb Jingang Wang:
> 
> What should I do if I want I create an Index with it active, and query it
> 
> > when I need, because I need to add some documents into the index  
> > ceaselessly.
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)\*\*  
> topic/elasticsearch/\*\*l63cThzXKvI/unsubscribe?hl=en-\*\*US[https://groups.google.com/d/topic/elasticsearch/l63cThzXKvI/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/l63cThzXKvI/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> elasticsearch+unsubscribe@\*\*[googlegroups.com](http://googlegroups.com)[elasticsearch%2Bunsubscribe@googlegroups.com](mailto:elasticsearch%2Bunsubscribe@googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> .

--  
Wang Jingang(王金刚)  
Ph.D Candidate at  
Lab of High Volume Language Information Processing & Cloud Computing  
School of Computer Science  
Beijing Institute of Technology  
Beijing 100081  
P.R China

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:48am UTC](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993/26 "2017-07-06T02:48:11Z")

</div>



[Previous page](https://discuss.elastic.co/t/java-lang-arrayindexoutofboundsexception-0/10993.md?page=1)
