# Problem with Java Analyzer API

**URL:** <https://discuss.elastic.co/t/problem-with-java-analyzer-api/6985>\
**Category:** Elasticsearch\
**Created:** [March 13, 2012, 7:52pm UTC](https://discuss.elastic.co/t/problem-with-java-analyzer-api/6985 "2012-03-13T19:52:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_McGill](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@James\_McGill](https://discuss.elastic.co/u/James_McGill)\
**Post date:** [March 13, 2012, 7:52pm UTC](https://discuss.elastic.co/t/problem-with-java-analyzer-api/6985/1 "2012-03-13T19:52:42Z")

</div>

When I run the attached test program against 0.19.0, it fails with:

org.elasticsearch.cluster.block.ClusterBlockException: blocked by:  
[SERVICE\_UNAVAILABLE/1/state not recovered /  
initialized];[SERVICE\_UNAVAILABLE/2/no master];

It works with 0.18.7.

Can anyone duplicate this result?

$ java -version  
java version "1.6.0\_27"

curl -XPUT '[http://localhost:9200/twitter/](http://localhost:9200/twitter/)'  
javac test/AnalyzerTest.java

java test.AnalyzerTest twitter whitespace Analyze This

curl -XDELETE '[http://localhost:9200/twitter/](http://localhost:9200/twitter/)'

Regards,

James

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 14, 2012, 12:13pm UTC](https://discuss.elastic.co/t/problem-with-java-analyzer-api/6985/2 "2012-03-14T12:13:59Z")

</div>

This failure means that the node you connected to has not initialized yet, or, that the client failed to connect to the cluster. Can you check the logs and see if it manages to connect successfully (the client) and if the cluster it connects to is up and running?

Btw, there is a problem with the analyze API (manifested differently than the problem you posted): [RemoteTransportException on \_analyze request to specific index · Issue #1770 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1770).

On Tuesday, March 13, 2012 at 9:52 PM, James McGill wrote:

> When I run the attached test program against 0.19.0, it fails with:
> 
> org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE\_UNAVAILABLE/1/state not recovered / initialized];[SERVICE\_UNAVAILABLE/2/no master];
> 
> It works with 0.18.7.
> 
> Can anyone duplicate this result?
> 
> $ java -version  
> java version "1.6.0\_27"
> 
> curl -XPUT '[http://localhost:9200/twitter/](http://localhost:9200/twitter/)'  
> javac test/AnalyzerTest.java
> 
> java test.AnalyzerTest twitter whitespace Analyze This
> 
> curl -XDELETE '[http://localhost:9200/twitter/](http://localhost:9200/twitter/)'
> 
> Regards,
> 
> James
> 
> Attachments:
> 
> - AnalyzerTest.java

---

<div class="post-metadata">

**Author:** ![James\_McGill](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@James\_McGill](https://discuss.elastic.co/u/James_McGill)\
**Post date:** [March 14, 2012, 4:48pm UTC](https://discuss.elastic.co/t/problem-with-java-analyzer-api/6985/3 "2012-03-14T16:48:28Z")

</div>

Thank you, Shay. The 0.19.1-SNAPSHOT resolves my issue as well.

On Wednesday, March 14, 2012 5:13:59 AM UTC-7, kimchy wrote:

> This failure means that the node you connected to has not initialized  
> yet, or, that the client failed to connect to the cluster. Can you check  
> the logs and see if it manages to connect successfully (the client) and if  
> the cluster it connects to is up and running?
> 
> Btw, there is a problem with the analyze API (manifested differently than  
> the problem you posted):  
> [RemoteTransportException on \_analyze request to specific index · Issue #1770 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1770).

---

<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, 3:36am UTC](https://discuss.elastic.co/t/problem-with-java-analyzer-api/6985/4 "2017-07-06T03:36:07Z")

</div>

Closed on July 6, 2017, 3:36am UTC


