1

I am trying to create an index using Elastic Search Java API.

My code is similar to this:

String indexName = "clients";
Node node =  new NodeBuilder().clusterName(this.clusterName).client(true).node();
Client client = node.client();

client.admin().indices().prepareCreate(indexName).execute().actionGet(); // It fails here

if (client != null) client.close();
if (node != null) node.close();

But every time, I execute that I get this error: http://screencast.com/t/MfnTccwho

What am I doing wrong?

1
  • 1
    Please post the error into the question properly, not a link to a picture of one. Commented May 15, 2012 at 19:22

2 Answers 2

2

It looks like mismatch between elasticsearch client version and elasticsearch server version.

Sign up to request clarification or add additional context in comments.

Comments

0

You should also check that jvm versions of the elasticsearch cluster and your client match, it happened to me that my client was 1.7 and elasticsearch was running under openjdk 1.6, throwing that exception.

Once both elasticsearch & java versions match you'll get the "real" exception :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.