Trouble starting up, simple Java API code not finding index that I can query using Marvel/Sense

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Trouble starting up, simple Java API code not finding index that I can query using Marvel/Sense

notoneword
This post has NOT been accepted by the mailing list yet.
I'm able to get results for

GET /wmq/objects/1

in Sense Console.

Starting with some basic Java API examples, the index is not found?  I started with various ways to query using the client, this is just the latest, but always the trouble finding the index.

public class ElasticSearchTest {
  public static void main (String[] args) {
    Node node = nodeBuilder().clusterName("elasticsearch_dev").node();
    Client client = node.client();
    GetResponse response = client.prepareGet("wmq", "objects", "1").execute().actionGet();
    System.out.println("RSP: " + response.toString());
  }
}


...

Exception in thread "main" org.elasticsearch.indices.IndexMissingException: [wmq] missing
        at org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:789)
        at org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:707)
        at org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:763)
        at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.<init>(TransportShardSingleOperationAction.java:139)
        at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.<init>(TransportShardSingleOperationAction.java:116)
        at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
        at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
        at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
        at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
        at org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:197)
        at org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
        at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
        at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)



Anything I'm missing in configuration so that Java can access the cluster and node?  I'm running the code from same machine where elastic is installed, have double-checked the cluster.name in yml file.

Any help would be appreciated, thanks!
Tom