# Elasticsearch java interaction

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-interaction/16375>\
**Category:** Elasticsearch\
**Created:** [March 14, 2014, 12:47pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375 "2014-03-14T12:47:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 14, 2014, 12:47pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/1 "2014-03-14T12:47:02Z")

</div>

Hi,  
I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
to communicate java elastisearch,i have gone through the elasticsearch java  
api's

1st i came across maven repositry.  
i have created pom.xml in my eclipse and in the dependency tag i have  
just placed the code that i found in maven repositry

```
         i.e.  

```

 org.elasticsearch elasticsearch ${es.version}

After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
TransportClient.

main()  
{  
Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9200));

```
	// on shutdown

	client.close();
	
	Settings settings = ImmutableSettings.settingsBuilder()
	        .put("client.transport.sniff", true).build();
	TransportClient client1 = new TransportClient(settings);

```

}

After running this app javapplication,i am getting the errors like this

In Main Method  
Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
INFO: [Mister Machine] loaded []  
org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
at ES\_Client.main(ES\_Client.java:64)  
Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 17 more  
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at java.lang.Class.getDeclaredFields0(Native Method)  
at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
at java.lang.Class.getDeclaredFields(Unknown Source)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 27 more  
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 41 more

from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.

Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to elastic search.

any basic application so that i can look and get some idea.

URGENT PLZ

Thanks in advance.

Regards Venu.Y

--  
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/c7e70df2-85bc-47cd-a62e-08f89926d796%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c7e70df2-85bc-47cd-a62e-08f89926d796%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 14, 2014, 1:09pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/2 "2014-03-14T13:09:08Z")

</div>

What is the value of ${es.version}

Did you set it? Try with 1.0.1  
Also transport layer uses 9300 ports and not 9200 ports (REST layer)

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

Le 14 mars 2014 à 13:47, Venu Krishna [yvgk2010@gmail.com](mailto:yvgk2010@gmail.com) a écrit :

Hi,  
I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's

1st i came across maven repositry.  
i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry

```
         i.e.  

```

 org.elasticsearch elasticsearch ${es.version}

After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
TransportClient.

main()  
{  
Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9200));

```
	// on shutdown

	client.close();
	
	Settings settings = ImmutableSettings.settingsBuilder()
	        .put("client.transport.sniff", true).build();
	TransportClient client1 = new TransportClient(settings);

```

}

After running this app javapplication,i am getting the errors like this

In Main Method  
Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
INFO: [Mister Machine] loaded []  
org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
at ES\_Client.main(ES\_Client.java:64)  
Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 17 more  
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at java.lang.Class.getDeclaredFields0(Native Method)  
at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
at java.lang.Class.getDeclaredFields(Unknown Source)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 27 more  
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 41 more

from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.

Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to elastic search.

any basic application so that i can look and get some idea.

URGENT PLZ

Thanks in advance.

Regards Venu.Y

--  
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/c7e70df2-85bc-47cd-a62e-08f89926d796%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c7e70df2-85bc-47cd-a62e-08f89926d796%40googlegroups.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/7390A48D-3F2C-46D2-B8D8-44A74314D83A%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/7390A48D-3F2C-46D2-B8D8-44A74314D83A%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 19, 2014, 9:32am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/3 "2014-03-19T09:32:53Z")

</div>

Hi David Pilato,i have followed you suggestions but still facing the same  
problem, you can see my new error is like this

java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x56b6d31c]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x52c11156]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x0e757105]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x043f68d7]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x71bb7179]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x034704d9]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x4ac91722]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at  
org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at  
org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:505)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Can you send me the any possible steps so that it will be helpful .

Thankyou in advance.

On Friday, March 14, 2014 6:17:02 PM UTC+5:30, Venu Krishna wrote:

> Hi,  
> I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
> to communicate java elastisearch,i have gone through the elasticsearch java  
> api's
> 
> 1st i came across maven repositry.  
> i have created pom.xml in my eclipse and in the dependency tag i have  
> just placed the code that i found in maven repositry
> 
> ```
> i.e.  
> 
> ```
> 
> org.elasticsearch elasticsearch ${es.version}
> 
> After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> TransportClient.
> 
> main()  
> {  
> Client client = new TransportClient()  
> .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> 
> ```
> // on shutdown
> 
> client.close();
>   
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("client.transport.sniff", true).build();
> TransportClient client1 = new TransportClient(settings);
> 
> ```
> 
> }
> 
> After running this app javapplication,i am getting the errors like this
> 
> In Main Method  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> INFO: [Mister Machine] loaded   
> org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> at ES\_Client.main(ES\_Client.java:64)  
> Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 17 more  
> Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at java.lang.Class.getDeclaredFields0(Native Method)  
> at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> at java.lang.Class.getDeclaredFields(Unknown Source)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 27 more  
> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.security.AccessController.doPrivileged(Native Method)  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> ... 41 more
> 
> from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> 
> Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> 
> any basic application so that i can look and get some idea.
> 
> URGENT PLZ
> 
> Thanks in advance.
> 
> Regards Venu.Y

--  
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/6073eeaf-7dc3-4c73-bd0a-c39b5a579e1a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6073eeaf-7dc3-4c73-bd0a-c39b5a579e1a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 19, 2014, 9:39am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/4 "2014-03-19T09:39:54Z")

</div>

I have no idea.  
Not enough details about what you actually did.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 19 mars 2014 à 10:32:58, Venu Krishna ([yvgk2010@gmail.com](mailto:yvgk2010@gmail.com)) a écrit:

Hi David Pilato,i have followed you suggestions but still facing the same problem, you can see my new error is like this

java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x56b6d31c]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x52c11156]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x0e757105]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x043f68d7]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x71bb7179]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x034704d9]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:502)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Mar 19, 2014 2:57:57 PM org.elasticsearch.transport.netty  
WARNING: [Skullcrusher] Exception caught on netty layer [[id: 0x4ac91722]]  
java.nio.channels.UnresolvedAddressException  
at sun.nio.ch.Net.checkAddress(Unknown Source)  
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:140)  
at org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:103)  
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:555)  
at org.elasticsearch.common.netty.channel.Channels.connect(Channels.java:541)  
at org.elasticsearch.common.netty.channel.AbstractChannel.connect(AbstractChannel.java:218)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:227)  
at org.elasticsearch.common.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)  
at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:505)  
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:473)  
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:126)  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledConnectNodeSampler.run(TransportClientNodesService.java:169)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Can you send me the any possible steps so that it will be helpful .

Thankyou in advance.

On Friday, March 14, 2014 6:17:02 PM UTC+5:30, Venu Krishna wrote:  
Hi,  
I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's

1st i came across maven repositry.  
i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry

```
         i.e. 

```

 org.elasticsearch elasticsearch ${es.version}

After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
TransportClient.

main()  
{  
Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9200));

```
           // on shutdown

        client.close();
       
     Settings settings = ImmutableSettings.settingsBuilder()
               .put("client.transport.sniff", true).build();
        TransportClient client1 = new TransportClient(settings);

```

}

After running this app javapplication,i am getting the errors like this

In Main Method  
Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
INFO: [Mister Machine] loaded []  
org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
at ES\_Client.main(ES\_Client.java:64)  
Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 17 more  
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at java.lang.Class.getDeclaredFields0(Native Method)  
at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
at java.lang.Class.getDeclaredFields(Unknown Source)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 27 more  
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 41 more

from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.

Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to elastic search.

any basic application so that i can look and get some idea.

URGENT PLZ

Thanks in advance.

Regards Venu.Y

--  
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/6073eeaf-7dc3-4c73-bd0a-c39b5a579e1a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6073eeaf-7dc3-4c73-bd0a-c39b5a579e1a%40googlegroups.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/etPan.532965ea.1cf10fd8.97ca%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.532965ea.1cf10fd8.97ca%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 20, 2014, 7:35am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/6 "2014-03-20T07:35:25Z")

</div>

Hi Georgi Ivanov,  
yes,i am able to understand the Exception i.e.  
UnresolvedAddressException,but you are telling that to make sure host1 and  
host2 are resolved by adding entries to /etc/hosts to wherever the file in  
on Windows,for this can you give me the steps how to approach this.Sorry i  
am new to this and am learning i am unable to get the proper example.Thanks  
in advance for the help.

On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:

> Well  
> I think UnresolvedAddressException obviously means that your Java client  
> can not resolve host1 and host2
> 
> make sure host1 and host2 are resolvable by adding entries to /etc/hosts  
> ot wherever the file in on Windows
> 
> On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> 
> > Hi,  
> > I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
> > to communicate java elastisearch,i have gone through the elasticsearch java  
> > api's
> > 
> > 1st i came across maven repositry.  
> > i have created pom.xml in my eclipse and in the dependency tag i have  
> > just placed the code that i found in maven repositry
> > 
> > ```
> > i.e.  
> > 
> > ```
> > 
> > org.elasticsearch elasticsearch ${es.version}
> > 
> > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> > TransportClient.
> > 
> > main()  
> > {  
> > Client client = new TransportClient()  
> > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > 
> > ```
> > // on shutdown
> > 
> > client.close();
> >   
> > Settings settings = ImmutableSettings.settingsBuilder()
> > .put("client.transport.sniff", true).build();
> > TransportClient client1 = new TransportClient(settings);
> > 
> > ```
> > 
> > }
> > 
> > After running this app javapplication,i am getting the errors like this
> > 
> > In Main Method  
> > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > INFO: [Mister Machine] loaded   
> > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> > at ES\_Client.main(ES\_Client.java:64)  
> > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > ... 17 more  
> > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at java.lang.Class.getDeclaredFields0(Native Method)  
> > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > ... 27 more  
> > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > at java.net.URLClassLoader$1.run(Unknown Source)  
> > at java.net.URLClassLoader$1.run(Unknown Source)  
> > at java.security.AccessController.doPrivileged(Native Method)  
> > at java.net.URLClassLoader.findClass(Unknown Source)  
> > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > ... 41 more
> > 
> > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > 
> > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > 
> > any basic application so that i can look and get some idea.
> > 
> > URGENT PLZ
> > 
> > Thanks in advance.
> > 
> > Regards Venu.Y

--  
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/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 20, 2014, 1:34pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/8 "2014-03-20T13:34:42Z")

</div>

Thankyou for the reply.I am not getting any errors,but i am not able to  
connect to my elasticsearch using java.Here my code.

import java.net.InetSocketAddress;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
void function()
{
    //on StartUp
            System.out.println("In Function");
    
    Client client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 

```

9200)); // This is where my control is getting stuck,without any  
exceptions or errors.

```
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

public static void main(String[] args) {
    
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
    jc.function();
    
}

```

}

On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:

> On Linux the file is /etc/hosts  
> On Windows c:\windows\system32\drivers\etc\hosts
> 
> Open the file in text editor
> 
> Add following lines:  
> 192.168.1.100 host1  
> 192.168.1.101 host2
> 
> Make sure that 192.168.1.100/101 is the right IP address of the  
> host1/host2
> 
> 2014-03-20 8:35 GMT+01:00 Venu Krishna \<[yvgk...@gmail.com](mailto:yvgk...@gmail.com) \<javascript:\>\>:
> 
> > Hi Georgi Ivanov,  
> > yes,i am able to understand the Exception i.e.  
> > UnresolvedAddressException,but you are telling that to make sure host1 and  
> > host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> > on Windows,for this can you give me the steps how to approach this.Sorry i  
> > am new to this and am learning i am unable to get the proper example.Thanks  
> > in advance for the help.
> > 
> > On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:
> > 
> > > Well  
> > > I think UnresolvedAddressException obviously means that your Java  
> > > client can not resolve host1 and host2
> > > 
> > > make sure host1 and host2 are resolvable by adding entries to  
> > > /etc/hosts ot wherever the file in on Windows
> > > 
> > > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> > > 
> > > > Hi,  
> > > > I am Y.Venu,i am totally new to this elasticsearch,now i am  
> > > > trying to communicate java elastisearch,i have gone through the  
> > > > elasticsearch java api's
> > > > 
> > > > 1st i came across maven repositry.  
> > > > i have created pom.xml in my eclipse and in the dependency tag i  
> > > > have just placed the code that i found in maven repositry
> > > > 
> > > > ```
> > > > i.e.  
> > > > 
> > > > ```
> > > > 
> > > > org.elasticsearch
> > > > 
> > > > ```
> > > > <artifactId>elasticsearch</artifactId>
> > > > 
> > > > <version>${es.version}</version>
> > > > 
> > > > ```
> > > > 
> > > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.
> > > > 
> > > > TransportClient.
> > > > 
> > > > main()  
> > > > {  
> > > > Client client = new TransportClient()  
> > > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > > 
> > > > ```
> > > > // on shutdown
> > > > 
> > > > client.close();
> > > >   
> > > > Settings settings = ImmutableSettings.settingsBuilder()
> > > > .put("client.transport.sniff", true).build();
> > > > TransportClient client1 = new TransportClient(settings);
> > > > 
> > > > ```
> > > > 
> > > > }
> > > > 
> > > > After running this app javapplication,i am getting the errors like this
> > > > 
> > > > In Main Method  
> > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...
> > > > 
> > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > > INFO: [Mister Machine] loaded   
> > > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;
> > > > 
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)
> > > > 
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
> > > > 
> > > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)
> > > > 
> > > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> > > > 
> > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
> > > > 
> > > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
> > > > 
> > > > at ES\_Client.main(ES\_Client.java:64)  
> > > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)
> > > > 
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)
> > > > 
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > ... 17 more  
> > > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > at java.lang.Class.getDeclaredFields0(Native Method)
> > > > 
> > > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)
> > > > 
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)
> > > > 
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)
> > > > 
> > > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)
> > > > 
> > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
> > > > 
> > > > ... 27 more  
> > > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > 
> > > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > 
> > > > ... 41 more
> > > > 
> > > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > > 
> > > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > > 
> > > > any basic application so that i can look and get some idea.
> > > > 
> > > > URGENT PLZ
> > > > 
> > > > Thanks in advance.
> > > > 
> > > > Regards Venu.Y
> > > > 
> > > > --  
> > > > 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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
> > > > To unsubscribe from this group and all its topics, send an email to  
> > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > 
> > 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/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 20, 2014, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/9 "2014-03-20T13:42:14Z")

</div>

Use port 9300

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

Le 20 mars 2014 à 14:34, Venu Krishna [yvgk2010@gmail.com](mailto:yvgk2010@gmail.com) a écrit :

Thankyou for the reply.I am not getting any errors,but i am not able to connect to my elasticsearch using java.Here my code.

import java.net.InetSocketAddress;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
void function()
{
    //on StartUp
            System.out.println("In Function");
    
    Client client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9200)); // This is where my control is getting stuck,without any exceptions or errors.
    
    
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

public static void main(String[] args) {
    
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
    jc.function();
    
}

```

}

> On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:  
> On Linux the file is /etc/hosts  
> On Windows c:\windows\system32\drivers\etc\hosts
> 
> Open the file in text editor
> 
> Add following lines:  
> 192.168.1.100 host1  
> 192.168.1.101 host2
> 
> Make sure that 192.168.1.100/101 is the right IP address of the host1/host2
> 
> 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> 
> > Hi Georgi Ivanov,  
> > yes,i am able to understand the Exception i.e. UnresolvedAddressException,but you are telling that to make sure host1 and host2 are resolved by adding entries to /etc/hosts to wherever the file in on Windows,for this can you give me the steps how to approach this.Sorry i am new to this and am learning i am unable to get the proper example.Thanks in advance for the help.
> > 
> > > On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:  
> > > Well  
> > > I think UnresolvedAddressException obviously means that your Java client can not resolve host1 and host2
> > > 
> > > make sure host1 and host2 are resolvable by adding entries to /etc/hosts ot wherever the file in on Windows
> > > 
> > > > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:  
> > > > Hi,  
> > > > I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's
> > > > 
> > > > 1st i came across maven repositry.  
> > > > i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry
> > > > 
> > > > ```
> > > > i.e.  
> > > > 
> > > > ```
> > > > 
> > > > org.elasticsearch
> > > > 
> > > > ```
> > > > <artifactId>elasticsearch</artifactId>
> > > > 
> > > > <version>${es.version}</version>
> > > > 
> > > > ```
> > > > 
> > > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.
> > > > 
> > > > TransportClient.
> > > > 
> > > > main()  
> > > > {  
> > > > Client client = new TransportClient()  
> > > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > > 
> > > > ```
> > > > // on shutdown
> > > > 
> > > > client.close();
> > > >   
> > > > Settings settings = ImmutableSettings.settingsBuilder()
> > > > .put("client.transport.sniff", true).build();
> > > > TransportClient client1 = new TransportClient(settings);
> > > > 
> > > > ```
> > > > 
> > > > }
> > > > 
> > > > After running this app javapplication,i am getting the errors like this
> > > > 
> > > > In Main Method  
> > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...
> > > > 
> > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > > INFO: [Mister Machine] loaded   
> > > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;
> > > > 
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)
> > > > 
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
> > > > 
> > > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)
> > > > 
> > > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> > > > 
> > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
> > > > 
> > > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
> > > > 
> > > > at ES\_Client.main(ES\_Client.java:64)  
> > > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)
> > > > 
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)
> > > > 
> > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > ... 17 more  
> > > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > at java.lang.Class.getDeclaredFields0(Native Method)
> > > > 
> > > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)
> > > > 
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)
> > > > 
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)
> > > > 
> > > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)
> > > > 
> > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)
> > > > 
> > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
> > > > 
> > > > ... 27 more  
> > > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > 
> > > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > 
> > > > ... 41 more
> > > > 
> > > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > > 
> > > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > > 
> > > > any basic application so that i can look and get some idea.
> > > > 
> > > > URGENT PLZ
> > > > 
> > > > Thanks in advance.
> > > > 
> > > > Regards Venu.Y
> > 
> > --  
> > 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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.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/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.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/D671E637-E831-4593-8567-FCE8AC498D60%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/D671E637-E831-4593-8567-FCE8AC498D60%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 20, 2014, 1:51pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/10 "2014-03-20T13:51:50Z")

</div>

Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you  
told i have replaced 9200 with 9300 in the above code ,then i executed the  
application i am getting following exceptions.

Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Connected  
Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Thankyou

On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:

> Use port 9300
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 20 mars 2014 à 14:34, Venu Krishna \<[yvgk...@gmail.com](mailto:yvgk...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Thankyou for the reply.I am not getting any errors,but i am not able to  
> connect to my elasticsearch using java.Here my code.
> 
> import java.net.InetSocketAddress;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>     
> Client client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 
> 
> ```
> 
> 9200)); // This is where my control is getting stuck,without any  
> exceptions or errors.
> 
> ```
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> public static void main(String[] args) {
>     
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> jc.function();
>     
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:
> 
> > On Linux the file is /etc/hosts  
> > On Windows c:\windows\system32\drivers\etc\hosts
> > 
> > Open the file in text editor
> > 
> > Add following lines:  
> > 192.168.1.100 host1  
> > 192.168.1.101 host2
> > 
> > Make sure that 192.168.1.100/101 is the right IP address of the  
> > host1/host2
> > 
> > 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> > 
> > > Hi Georgi Ivanov,  
> > > yes,i am able to understand the Exception i.e.  
> > > UnresolvedAddressException,but you are telling that to make sure host1 and  
> > > host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> > > on Windows,for this can you give me the steps how to approach this.Sorry i  
> > > am new to this and am learning i am unable to get the proper example.Thanks  
> > > in advance for the help.
> > > 
> > > On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:
> > > 
> > > > Well  
> > > > I think UnresolvedAddressException obviously means that your Java  
> > > > client can not resolve host1 and host2
> > > > 
> > > > make sure host1 and host2 are resolvable by adding entries to  
> > > > /etc/hosts ot wherever the file in on Windows
> > > > 
> > > > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> > > > 
> > > > > Hi,  
> > > > > I am Y.Venu,i am totally new to this elasticsearch,now i am  
> > > > > trying to communicate java elastisearch,i have gone through the  
> > > > > elasticsearch java api's
> > > > > 
> > > > > 1st i came across maven repositry.  
> > > > > i have created pom.xml in my eclipse and in the dependency tag i  
> > > > > have just placed the code that i found in maven repositry
> > > > > 
> > > > > ```
> > > > > i.e.  
> > > > > 
> > > > > ```
> > > > > 
> > > > > org.elasticsearch
> > > > > 
> > > > > ```
> > > > > <artifactId>elasticsearch</artifactId>
> > > > > 
> > > > > <version>${es.version}</version>
> > > > > 
> > > > > ```
> > > > > 
> > > > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.
> > > > > 
> > > > > TransportClient.
> > > > > 
> > > > > main()  
> > > > > {  
> > > > > Client client = new TransportClient()  
> > > > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > > > 
> > > > > ```
> > > > > // on shutdown
> > > > > 
> > > > > client.close();
> > > > >   
> > > > > Settings settings = ImmutableSettings.settingsBuilder()
> > > > > .put("client.transport.sniff", true).build();
> > > > > TransportClient client1 = new TransportClient(settings);
> > > > > 
> > > > > ```
> > > > > 
> > > > > }
> > > > > 
> > > > > After running this app javapplication,i am getting the errors like this
> > > > > 
> > > > > In Main Method  
> > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...
> > > > > 
> > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > > > INFO: [Mister Machine] loaded   
> > > > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;
> > > > > 
> > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
> > > > > 
> > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)
> > > > > 
> > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
> > > > > 
> > > > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)
> > > > > 
> > > > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> > > > > 
> > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
> > > > > 
> > > > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
> > > > > 
> > > > > at ES\_Client.main(ES\_Client.java:64)  
> > > > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
> > > > > 
> > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
> > > > > 
> > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)
> > > > > 
> > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)
> > > > > 
> > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)
> > > > > 
> > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > > ... 17 more  
> > > > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > at java.lang.Class.getDeclaredFields0(Native Method)
> > > > > 
> > > > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)
> > > > > 
> > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)
> > > > > 
> > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)
> > > > > 
> > > > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)
> > > > > 
> > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)
> > > > > 
> > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
> > > > > 
> > > > > ... 27 more  
> > > > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > 
> > > > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > 
> > > > > ... 41 more
> > > > > 
> > > > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > > > 
> > > > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > > > 
> > > > > any basic application so that i can look and get some idea.
> > > > > 
> > > > > URGENT PLZ
> > > > > 
> > > > > Thanks in advance.
> > > > > 
> > > > > Regards Venu.Y
> > > > > 
> > > > > --  
> > > > > 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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
> > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .
> > > 
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > 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/e94ccdc1-62a9-49df-ba9b-182b397997ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e94ccdc1-62a9-49df-ba9b-182b397997ab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 21, 2014, 10:09am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/12 "2014-03-21T10:09:36Z")

</div>

you can find my elasticsearch window i.e overview window and browse window.  
my java code you can see below.

from these windows i think you can get what i am doing.  
i just create new indexes with type and their id simply .  
before this i din't created any cluster or any node e.t.c. ,from my  
knowledge i have not created,but from ES site i came to know that cluster  
will be created bydefault and node aswell,but i have not given any cluster  
name or any specific thing or nodes.

i think i am not making any complication about this.

but to be frank..i am moving here and there like a child to know what is  
happening.

Java Code

import java.net.InetSocketAddress;  
import java.util.HashSet;  
import java.util.Set;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.cluster.node.DiscoveryNode;  
import org.elasticsearch.common.settings.ImmutableSettings;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
Client client;
Set<String> hosts;

void function()
{
    //on StartUp
            System.out.println("In Function");
    
client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 

```

9300));

```
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

 void connectES() {
    hosts = new HashSet<String>();
      hosts.add("locolhost");
    // hosts.add("host2.host1.mydomain.com"); // Make sure this 

```

resolvs to proper IP address  
Settings settings =  
ImmutableSettings.settingsBuilder().put("cluster.name",  
"vesseltrackerES").build();

```
      TransportClient transportClient = new TransportClient(settings);
      for (String host : this.hosts) {
    transportClient = transportClient.addTransportAddress(new 

```

InetSocketTransportAddress(host, 9200));  
}

```
      System.out.print("Connected to nodes : ");
      for (DiscoveryNode node : transportClient.connectedNodes()) {
    System.out.print(node.getName() + " , ");
      }
      System.out.println("");

      this.client = (Client) transportClient;
    }

public static void main(String[] args) {
    
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
// jc.function();
    jc.connectES();
    
}

```

}

On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:

> There is something wrong with your set-up
> 
> How many ES node s you have ?  
> On which IP addresses are ES hosts listening ?
> 
> I understood you have 2 hosts , but it seems you have only one on your  
> local machine .
> 
> This is the code (a bit modified) I am using at the moment
> 
> public void connectES() {  
> Set hosts = new HashSet();  
> hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
> hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to  
> proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("  
> cluster.name", "vesseltrackerES").build();
> 
> TransportClient transportClient = new TransportClient(settings);  
> for (String host : this.hosts) {  
> transportClient = transportClient.addTransportAddress(new  
> InetSocketTransportAddress(host, 9300));  
> }
> 
> System.out.print("Connected to nodes : ");  
> for (DiscoveryNode node : transportClient.connectedNodes()) {  
> System.out.print(node.getHostName() + " , ");  
> }  
> System.out.println("");
> 
> this.client = (Client) transportClient;  
> }
> 
> On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:
> 
> > Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you  
> > told i have replaced 9200 with 9300 in the above code ,then i executed the  
> > application i am getting following exceptions.
> > 
> > Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
> > WARNING: [Bailey, Gailyn] failed to get node info for  
> > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > org.elasticsearch.transport.NodeDisconnectedException:  
> > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > 
> > Connected  
> > Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> > WARNING: [Bailey, Gailyn] failed to get node info for  
> > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > org.elasticsearch.transport.NodeDisconnectedException:  
> > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > 
> > Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> > WARNING: [Bailey, Gailyn] failed to get node info for  
> > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > org.elasticsearch.transport.NodeDisconnectedException:  
> > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > 
> > Thankyou
> > 
> > On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:
> > 
> > > Use port 9300
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :
> > > 
> > > Thankyou for the reply.I am not getting any errors,but i am not able to  
> > > connect to my elasticsearch using java.Here my code.
> > > 
> > > import java.net.InetSocketAddress;
> > > 
> > > import org.elasticsearch.client.Client;  
> > > import org.elasticsearch.client.transport.TransportClient;  
> > > import org.elasticsearch.common.transport.InetSocketTransportAddress;
> > > 
> > > public class JavaES\_Client {
> > > 
> > > ```
> > > void function()
> > > {
> > > //on StartUp
> > > System.out.println("In Function");
> > >     
> > > Client client = new TransportClient()
> > > .addTransportAddress(new InetSocketTransportAddress("localhost", 
> > > 
> > > ```
> > > 
> > > 9200)); // This is where my control is getting stuck,without any  
> > > exceptions or errors.
> > > 
> > > ```
> > > System.out.println("Connected");
> > > //on ShutDown
> > > client.close();
> > > }
> > > 
> > > public static void main(String[] args) {
> > >     
> > > System.out.println("In Main Method");
> > > JavaES_Client jc = new JavaES_Client();
> > > System.out.println("Object Created");
> > > jc.function();
> > >     
> > > }
> > > 
> > > ```
> > > 
> > > }
> > > 
> > > On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:
> > > 
> > > > On Linux the file is /etc/hosts  
> > > > On Windows c:\windows\system32\drivers\etc\hosts
> > > > 
> > > > Open the file in text editor
> > > > 
> > > > Add following lines:  
> > > > 192.168.1.100 host1  
> > > > 192.168.1.101 host2
> > > > 
> > > > Make sure that 192.168.1.100/101 is the right IP address of the  
> > > > host1/host2
> > > > 
> > > > 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> > > > 
> > > > > Hi Georgi Ivanov,  
> > > > > yes,i am able to understand the Exception i.e.  
> > > > > UnresolvedAddressException,but you are telling that to make sure host1 and  
> > > > > host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> > > > > on Windows,for this can you give me the steps how to approach this.Sorry i  
> > > > > am new to this and am learning i am unable to get the proper example.Thanks  
> > > > > in advance for the help.
> > > > > 
> > > > > On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:
> > > > > 
> > > > > > Well  
> > > > > > I think UnresolvedAddressException obviously means that your Java  
> > > > > > client can not resolve host1 and host2
> > > > > > 
> > > > > > make sure host1 and host2 are resolvable by adding entries to  
> > > > > > /etc/hosts ot wherever the file in on Windows
> > > > > > 
> > > > > > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> > > > > > 
> > > > > > > Hi,  
> > > > > > > I am Y.Venu,i am totally new to this elasticsearch,now i am  
> > > > > > > trying to communicate java elastisearch,i have gone through the  
> > > > > > > elasticsearch java api's
> > > > > > > 
> > > > > > > 1st i came across maven repositry.  
> > > > > > > i have created pom.xml in my eclipse and in the dependency tag i  
> > > > > > > have just placed the code that i found in maven repositry
> > > > > > > 
> > > > > > > ```
> > > > > > > i.e.  
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > org.elasticsearch
> > > > > > > 
> > > > > > > ```
> > > > > > > <artifactId>elasticsearch</artifactId>
> > > > > > > 
> > > > > > > <version>${es.version}</version>
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.
> > > > > > > 
> > > > > > > TransportClient.
> > > > > > > 
> > > > > > > main()  
> > > > > > > {  
> > > > > > > Client client = new TransportClient()  
> > > > > > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > > > > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > > > > > 
> > > > > > > ```
> > > > > > > // on shutdown
> > > > > > > 
> > > > > > > client.close();
> > > > > > >   
> > > > > > > Settings settings = ImmutableSettings.settingsBuilder()
> > > > > > > .put("client.transport.sniff", true).build();
> > > > > > > TransportClient client1 = new TransportClient(settings);
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > }
> > > > > > > 
> > > > > > > After running this app javapplication,i am getting the errors like this
> > > > > > > 
> > > > > > > In Main Method  
> > > > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > > > > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...
> > > > > > > 
> > > > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > > > > > INFO: [Mister Machine] loaded   
> > > > > > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > > > > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > > > > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > > > > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > > > > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > > > > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
> > > > > > > 
> > > > > > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > > > > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > > > > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
> > > > > > > 
> > > > > > > at ES\_Client.main(ES\_Client.java:64)  
> > > > > > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > > > > ... 17 more  
> > > > > > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > at java.lang.Class.getDeclaredFields0(Native Method)
> > > > > > > 
> > > > > > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > > > > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)
> > > > > > > 
> > > > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
> > > > > > > 
> > > > > > > ... 27 more  
> > > > > > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > > > 
> > > > > > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > > > 
> > > > > > > ... 41 more
> > > > > > > 
> > > > > > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > > > > > 
> > > > > > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > > > > > 
> > > > > > > any basic application so that i can look and get some idea.
> > > > > > > 
> > > > > > > URGENT PLZ
> > > > > > > 
> > > > > > > Thanks in advance.
> > > > > > > 
> > > > > > > Regards Venu.Y
> > > > > > > 
> > > > > > > --  
> > > > > > > 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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe)  
> > > > > > > .  
> > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > To view this discussion on the web visit  
> > > > > > > [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > .
> > > > > 
> > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > 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/6761c3cc-837a-454a-8f3f-46fc7a873007%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6761c3cc-837a-454a-8f3f-46fc7a873007%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 21, 2014, 10:10am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/13 "2014-03-21T10:10:50Z")

</div>

On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:

> you can find my elasticsearch window i.e overview window and browse  
> window.  
> my java code you can see below.
> 
> from these windows i think you can get what i am doing.  
> i just create new indexes with type and their id simply .  
> before this i din't created any cluster or any node e.t.c. ,from my  
> knowledge i have not created,but from ES site i came to know that cluster  
> will be created bydefault and node aswell,but i have not given any cluster  
> name or any specific thing or nodes.
> 
> i think i am not making any complication about this.
> 
> but to be frank..i am moving here and there like a child to know what is  
> happening.
> 
> Java Code
> 
> import java.net.InetSocketAddress;  
> import java.util.HashSet;  
> import java.util.Set;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.cluster.node.DiscoveryNode;  
> import org.elasticsearch.common.settings.ImmutableSettings;  
> import org.elasticsearch.common.settings.Settings;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> Client client;
> Set<String> hosts;
> 
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>     
> client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 
> 
> ```
> 
> 9300));
> 
> ```
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> void connectES() {
> hosts = new HashSet<String>();
> hosts.add("locolhost");
> // hosts.add("host2.host1.mydomain.com"); // Make sure this 
> 
> ```
> 
> resolvs to proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("  
> cluster.name", "vesseltrackerES").build();
> 
> ```
> TransportClient transportClient = new TransportClient(settings);
> for (String host : this.hosts) {
> transportClient = transportClient.addTransportAddress(new 
> 
> ```
> 
> InetSocketTransportAddress(host, 9200));  
> }
> 
> ```
> System.out.print("Connected to nodes : ");
> for (DiscoveryNode node : transportClient.connectedNodes()) {
> System.out.print(node.getName() + " , ");
> }
> System.out.println("");
> 
> this.client = (Client) transportClient;
> }
> 
> public static void main(String[] args) {
>     
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> // jc.function();
> jc.connectES();
>     
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:
> 
> > There is something wrong with your set-up
> > 
> > How many ES node s you have ?  
> > On which IP addresses are ES hosts listening ?
> > 
> > I understood you have 2 hosts , but it seems you have only one on your  
> > local machine .
> > 
> > This is the code (a bit modified) I am using at the moment
> > 
> > public void connectES() {  
> > Set hosts = new HashSet();  
> > hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
> > hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to  
> > proper IP address  
> > Settings settings = ImmutableSettings.settingsBuilder().put("  
> > cluster.name", "vesseltrackerES").build();
> > 
> > TransportClient transportClient = new TransportClient(settings);  
> > for (String host : this.hosts) {  
> > transportClient = transportClient.addTransportAddress(new  
> > InetSocketTransportAddress(host, 9300));  
> > }
> > 
> > System.out.print("Connected to nodes : ");  
> > for (DiscoveryNode node : transportClient.connectedNodes()) {  
> > System.out.print(node.getHostName() + " , ");  
> > }  
> > System.out.println("");
> > 
> > this.client = (Client) transportClient;  
> > }
> > 
> > On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:
> > 
> > > Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you  
> > > told i have replaced 9200 with 9300 in the above code ,then i executed the  
> > > application i am getting following exceptions.
> > > 
> > > Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
> > > WARNING: [Bailey, Gailyn] failed to get node info for  
> > > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > > org.elasticsearch.transport.NodeDisconnectedException:  
> > > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > > 
> > > Connected  
> > > Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> > > WARNING: [Bailey, Gailyn] failed to get node info for  
> > > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > > org.elasticsearch.transport.NodeDisconnectedException:  
> > > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > > 
> > > Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> > > WARNING: [Bailey, Gailyn] failed to get node info for  
> > > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > > org.elasticsearch.transport.NodeDisconnectedException:  
> > > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > > 
> > > Thankyou
> > > 
> > > On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:
> > > 
> > > > Use port 9300
> > > > 
> > > > --  
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :
> > > > 
> > > > Thankyou for the reply.I am not getting any errors,but i am not able to  
> > > > connect to my elasticsearch using java.Here my code.
> > > > 
> > > > import java.net.InetSocketAddress;
> > > > 
> > > > import org.elasticsearch.client.Client;  
> > > > import org.elasticsearch.client.transport.TransportClient;  
> > > > import org.elasticsearch.common.transport.InetSocketTransportAddress;
> > > > 
> > > > public class JavaES\_Client {
> > > > 
> > > > ```
> > > > void function()
> > > > {
> > > > //on StartUp
> > > > System.out.println("In Function");
> > > >     
> > > > Client client = new TransportClient()
> > > > .addTransportAddress(new 
> > > > 
> > > > ```
> > > > 
> > > > InetSocketTransportAddress("localhost", 9200)); // This is where my  
> > > > control is getting stuck,without any exceptions or errors.
> > > > 
> > > > ```
> > > > System.out.println("Connected");
> > > > //on ShutDown
> > > > client.close();
> > > > }
> > > > 
> > > > public static void main(String[] args) {
> > > >     
> > > > System.out.println("In Main Method");
> > > > JavaES_Client jc = new JavaES_Client();
> > > > System.out.println("Object Created");
> > > > jc.function();
> > > >     
> > > > }
> > > > 
> > > > ```
> > > > 
> > > > }
> > > > 
> > > > On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:
> > > > 
> > > > > On Linux the file is /etc/hosts  
> > > > > On Windows c:\windows\system32\drivers\etc\hosts
> > > > > 
> > > > > Open the file in text editor
> > > > > 
> > > > > Add following lines:  
> > > > > 192.168.1.100 host1  
> > > > > 192.168.1.101 host2
> > > > > 
> > > > > Make sure that 192.168.1.100/101 is the right IP address of the  
> > > > > host1/host2
> > > > > 
> > > > > 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> > > > > 
> > > > > > Hi Georgi Ivanov,  
> > > > > > yes,i am able to understand the Exception i.e.  
> > > > > > UnresolvedAddressException,but you are telling that to make sure host1 and  
> > > > > > host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> > > > > > on Windows,for this can you give me the steps how to approach this.Sorry i  
> > > > > > am new to this and am learning i am unable to get the proper example.Thanks  
> > > > > > in advance for the help.
> > > > > > 
> > > > > > On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:
> > > > > > 
> > > > > > > Well  
> > > > > > > I think UnresolvedAddressException obviously means that your Java  
> > > > > > > client can not resolve host1 and host2
> > > > > > > 
> > > > > > > make sure host1 and host2 are resolvable by adding entries to  
> > > > > > > /etc/hosts ot wherever the file in on Windows
> > > > > > > 
> > > > > > > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> > > > > > > 
> > > > > > > > Hi,  
> > > > > > > > I am Y.Venu,i am totally new to this elasticsearch,now i am  
> > > > > > > > trying to communicate java elastisearch,i have gone through the  
> > > > > > > > elasticsearch java api's
> > > > > > > > 
> > > > > > > > 1st i came across maven repositry.  
> > > > > > > > i have created pom.xml in my eclipse and in the dependency tag  
> > > > > > > > i have just placed the code that i found in maven repositry
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > i.e.  
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > 
> > > > > > > > org.elasticsearch
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > <artifactId>elasticsearch</artifactId>
> > > > > > > > 
> > > > > > > > <version>${es.version}</version>
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > 
> > > > > > > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.
> > > > > > > > 
> > > > > > > > TransportClient.
> > > > > > > > 
> > > > > > > > main()  
> > > > > > > > {  
> > > > > > > > Client client = new TransportClient()  
> > > > > > > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > > > > > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > // on shutdown
> > > > > > > > 
> > > > > > > > client.close();
> > > > > > > >   
> > > > > > > > Settings settings = ImmutableSettings.settingsBuilder()
> > > > > > > > .put("client.transport.sniff", true).build();
> > > > > > > > TransportClient client1 = new TransportClient(settings);
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > 
> > > > > > > > }
> > > > > > > > 
> > > > > > > > After running this app javapplication,i am getting the errors like this
> > > > > > > > 
> > > > > > > > In Main Method  
> > > > > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > > > > > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...
> > > > > > > > 
> > > > > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > > > > > > INFO: [Mister Machine] loaded   
> > > > > > > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > > > > > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > > > > > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > > > > > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > > > > > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > > > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > > > > > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > > > > > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > > > > > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
> > > > > > > > 
> > > > > > > > at ES\_Client.main(ES\_Client.java:64)  
> > > > > > > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > > > > > ... 17 more  
> > > > > > > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > > at java.lang.Class.getDeclaredFields0(Native Method)
> > > > > > > > 
> > > > > > > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > > > > > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)
> > > > > > > > 
> > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
> > > > > > > > 
> > > > > > > > ... 27 more  
> > > > > > > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > > > > 
> > > > > > > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > > > > 
> > > > > > > > ... 41 more
> > > > > > > > 
> > > > > > > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > > > > > > 
> > > > > > > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > > > > > > 
> > > > > > > > any basic application so that i can look and get some idea.
> > > > > > > > 
> > > > > > > > URGENT PLZ
> > > > > > > > 
> > > > > > > > Thanks in advance.
> > > > > > > > 
> > > > > > > > Regards Venu.Y
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe)  
> > > > > > > > .  
> > > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > > To view this discussion on the web visit  
> > > > > > > > [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > > > .
> > > > > > 
> > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > 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/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 21, 2014, 10:18am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/14 "2014-03-21T10:18:44Z")

</div>

Do this:

public class JavaES\_Client {

```
private static Client client;

private static void buildClient() {
    Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();
    client = new TransportClient(settings)
            .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
}

public static void main(String[] args) {

    buildClient();

    SearchResponse response = client.prepareSearch().execute().actionGet();
    System.out.println("response.getHits().totalHits() = " + response.getHits().totalHits());
}

```

}

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk2010@gmail.com](mailto:yvgk2010@gmail.com)) a écrit:

On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:  
you can find my elasticsearch window i.e overview window and browse window.  
my java code you can see below.

from these windows i think you can get what i am doing.  
i just create new indexes with type and their id simply .  
before this i din't created any cluster or any node e.t.c. ,from my knowledge i have not created,but from ES site i came to know that cluster will be created bydefault and node aswell,but i have not given any cluster name or any specific thing or nodes.

i think i am not making any complication about this.

but to be frank..i am moving here and there like a child to know what is happening.

Java Code

import java.net.InetSocketAddress;  
import java.util.HashSet;  
import java.util.Set;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.cluster.node.DiscoveryNode;  
import org.elasticsearch.common.settings.ImmutableSettings;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
Client client;
Set<String> hosts;

void function()
{
    //on StartUp
            System.out.println("In Function");
   
client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
   
   
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

 void connectES() {
    hosts = new HashSet<String>();
      hosts.add("locolhost");
    // hosts.add("host2.host1.mydomain.com"); // Make sure this resolvs to proper IP address
      Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();

      TransportClient transportClient = new TransportClient(settings);
      for (String host : this.hosts) {
    transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9200));
      }

      System.out.print("Connected to nodes : ");
      for (DiscoveryNode node : transportClient.connectedNodes()) {
    System.out.print(node.getName() + " , ");
      }
      System.out.println("");

      this.client = (Client) transportClient;
    }

public static void main(String[] args) {
   
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
// jc.function();
    jc.connectES();
   
}

```

}

On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:  
There is something wrong with your set-up

How many ES node s you have ?  
On which IP addresses are ES hosts listening ?

I understood you have 2 hosts , but it seems you have only one on your local machine .

This is the code (a bit modified) I am using at the moment

public void connectES() {  
Set hosts = new HashSet();  
hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to proper IP address  
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();

TransportClient transportClient = new TransportClient(settings);  
for (String host : this.hosts) {  
transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9300));  
}

System.out.print("Connected to nodes : ");  
for (DiscoveryNode node : transportClient.connectedNodes()) {  
System.out.print(node.getHostName() + " , ");  
}  
System.out.println("");

this.client = (Client) transportClient;  
}

On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:  
Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you told i have replaced 9200 with 9300 in the above code ,then i executed the application i am getting following exceptions.

Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Connected  
Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Thankyou

On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:  
Use port 9300

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

Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :

Thankyou for the reply.I am not getting any errors,but i am not able to connect to my elasticsearch using java.Here my code.

import java.net.InetSocketAddress;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
void function()
{
    //on StartUp
            System.out.println("In Function");
   
    Client client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9200)); // This is where my control is getting stuck,without any exceptions or errors.
   
   
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

public static void main(String[] args) {
   
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
    jc.function();
   
}

```

}

On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:  
On Linux the file is /etc/hosts  
On Windows c:\windows\system32\drivers\etc\hosts

Open the file in text editor

Add following lines:  
192.168.1.100 host1  
192.168.1.101 host2

Make sure that 192.168.1.100/101 is the right IP address of the host1/host2

2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):  
Hi Georgi Ivanov,  
yes,i am able to understand the Exception i.e. UnresolvedAddressException,but you are telling that to make sure host1 and host2 are resolved by adding entries to /etc/hosts to wherever the file in on Windows,for this can you give me the steps how to approach this.Sorry i am new to this and am learning i am unable to get the proper example.Thanks in advance for the help.

On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:  
Well  
I think UnresolvedAddressException obviously means that your Java client can not resolve host1 and host2

make sure host1 and host2 are resolvable by adding entries to /etc/hosts ot wherever the file in on Windows

On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:  
Hi,  
I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's

1st i came across maven repositry.  
i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry

```
         i.e. 

```

 org.elasticsearch elasticsearch ${es.version}

After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
TransportClient.

main()  
{  
Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9200));

```
     // on shutdown

        client.close();
       
     Settings settings = ImmutableSettings.settingsBuilder()
             .put("client.transport.sniff", true).build();
        TransportClient client1 = new TransportClient(settings);

```

}

After running this app javapplication,i am getting the errors like this

In Main Method  
Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
INFO: [Mister Machine] loaded []  
org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
at ES\_Client.main(ES\_Client.java:64)  
Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 17 more  
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at java.lang.Class.getDeclaredFields0(Native Method)  
at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
at java.lang.Class.getDeclaredFields(Unknown Source)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 27 more  
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 41 more

from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.

Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to elastic search.

any basic application so that i can look and get some idea.

URGENT PLZ

Thanks in advance.

Regards Venu.Y

--  
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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
To unsubscribe from this group and all its topics, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.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/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.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/etPan.532c1204.3a95f874.c9bd%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.532c1204.3a95f874.c9bd%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 21, 2014, 11:02am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/15 "2014-03-21T11:02:15Z")

</div>

Exceptions and Warnings when i run the above code.

Mar 21, 2014 4:29:53 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:29:57 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:29:58 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:02 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:03 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:07 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:08 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:12 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:13 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:17 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:18 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:22 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:23 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:27 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:28 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Exception in thread "main"  
org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at  
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
at  
org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
at  
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
at  
org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
at  
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
at  
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
at JavaES\_Client.main(JavaES\_Client.java:82)

On Friday, March 21, 2014 3:48:44 PM UTC+5:30, David Pilato wrote:

> Do this:
> 
> public class JavaES\_Client {
> 
> ```
> private static Client client;
> 
> private static void buildClient() {
> Settings settings = ImmutableSettings.settingsBuilder().put("
> 
> ```
> 
> cluster.name", "vesseltrackerES").build();  
> client = new TransportClient(settings)  
> .addTransportAddress(new  
> InetSocketTransportAddress("localhost", 9300));  
> }
> 
> ```
> public static void main(String[] args) {
> 
> buildClient();
> 
> SearchResponse response = 
> 
> ```
> 
> client.prepareSearch().execute().actionGet();  
> System.out.println("response.getHits().totalHits() = " +  
> response.getHits().totalHits());  
> }
> 
> }
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:
> 
> > you can find my elasticsearch window i.e overview window and browse  
> > window.  
> > my java code you can see below.
> > 
> > from these windows i think you can get what i am doing.  
> > i just create new indexes with type and their id simply .  
> > before this i din't created any cluster or any node e.t.c. ,from my  
> > knowledge i have not created,but from ES site i came to know that cluster  
> > will be created bydefault and node aswell,but i have not given any cluster  
> > name or any specific thing or nodes.
> > 
> > i think i am not making any complication about this.
> > 
> > but to be frank..i am moving here and there like a child to know what is  
> > happening.
> > 
> > Java Code
> > 
> > import java.net.InetSocketAddress;  
> > import java.util.HashSet;  
> > import java.util.Set;
> > 
> > import org.elasticsearch.client.Client;  
> > import org.elasticsearch.client.transport.TransportClient;  
> > import org.elasticsearch.cluster.node.DiscoveryNode;  
> > import org.elasticsearch.common.settings.ImmutableSettings;  
> > import org.elasticsearch.common.settings.Settings;  
> > import org.elasticsearch.common.transport.InetSocketTransportAddress;
> > 
> > public class JavaES\_Client {
> > 
> > ```
> > Client client;
> > Set<String> hosts;
> > 
> > void function()
> > {
> > //on StartUp
> > System.out.println("In Function");
> >    
> > client = new TransportClient()
> > .addTransportAddress(new InetSocketTransportAddress("localhost", 
> > 
> > ```
> > 
> > 9300));
> > 
> > ```
> > System.out.println("Connected");
> > //on ShutDown
> > client.close();
> > }
> > 
> > void connectES() {
> > hosts = new HashSet<String>();
> > hosts.add("locolhost");
> > // hosts.add("host2.host1.mydomain.com"); // Make sure this 
> > 
> > ```
> > 
> > resolvs to proper IP address  
> > Settings settings = ImmutableSettings.settingsBuilder().put("  
> > cluster.name", "vesseltrackerES").build();
> > 
> > ```
> > TransportClient transportClient = new TransportClient(settings);
> > for (String host : this.hosts) {
> > transportClient = transportClient.addTransportAddress(new 
> > 
> > ```
> > 
> > InetSocketTransportAddress(host, 9200));  
> > }
> > 
> > ```
> > System.out.print("Connected to nodes : ");
> > for (DiscoveryNode node : transportClient.connectedNodes()) {
> > System.out.print(node.getName() + " , ");
> > }
> > System.out.println("");
> > 
> > this.client = (Client) transportClient;
> > }
> > 
> > public static void main(String[] args) {
> >    
> > System.out.println("In Main Method");
> > JavaES_Client jc = new JavaES_Client();
> > System.out.println("Object Created");
> > // jc.function();
> > jc.connectES();
> >    
> > }
> > 
> > ```
> > 
> > }
> > 
> > On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:
> > 
> > > There is something wrong with your set-up
> > > 
> > > How many ES node s you have ?  
> > > On which IP addresses are ES hosts listening ?
> > > 
> > > I understood you have 2 hosts , but it seems you have only one on your  
> > > local machine .
> > > 
> > > This is the code (a bit modified) I am using at the moment
> > > 
> > > public void connectES() {  
> > > Set hosts = new HashSet();  
> > > hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
> > > hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to  
> > > proper IP address  
> > > Settings settings = ImmutableSettings.settingsBuilder().put("  
> > > cluster.name", "vesseltrackerES").build();
> > > 
> > > TransportClient transportClient = new TransportClient(settings);  
> > > for (String host : this.hosts) {  
> > > transportClient = transportClient.addTransportAddress(new  
> > > InetSocketTransportAddress(host, 9300));  
> > > }
> > > 
> > > System.out.print("Connected to nodes : ");  
> > > for (DiscoveryNode node : transportClient.connectedNodes()) {  
> > > System.out.print(node.getHostName() + " , ");  
> > > }  
> > > System.out.println("");
> > > 
> > > this.client = (Client) transportClient;  
> > > }
> > > 
> > > On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:
> > > 
> > > > Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as  
> > > > you told i have replaced 9200 with 9300 in the above code ,then i executed  
> > > > the application i am getting following exceptions.
> > > > 
> > > > Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
> > > > WARNING: [Bailey, Gailyn] failed to get node info for  
> > > > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > > > org.elasticsearch.transport.NodeDisconnectedException:  
> > > > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > > > 
> > > > Connected  
> > > > Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> > > > WARNING: [Bailey, Gailyn] failed to get node info for  
> > > > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > > > org.elasticsearch.transport.NodeDisconnectedException:  
> > > > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > > > 
> > > > Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> > > > WARNING: [Bailey, Gailyn] failed to get node info for  
> > > > [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> > > > org.elasticsearch.transport.NodeDisconnectedException:  
> > > > [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> > > > 
> > > > Thankyou
> > > > 
> > > > On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:
> > > > 
> > > > > Use port 9300
> > > > > 
> > > > > --  
> > > > > David 😉  
> > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > 
> > > > > Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :
> > > > > 
> > > > > Thankyou for the reply.I am not getting any errors,but i am not able  
> > > > > to connect to my elasticsearch using java.Here my code.
> > > > > 
> > > > > import java.net.InetSocketAddress;
> > > > > 
> > > > > import org.elasticsearch.client.Client;  
> > > > > import org.elasticsearch.client.transport.TransportClient;  
> > > > > import org.elasticsearch.common.transport.InetSocketTransportAddress;
> > > > > 
> > > > > public class JavaES\_Client {
> > > > > 
> > > > > ```
> > > > > void function()
> > > > > {
> > > > > //on StartUp
> > > > > System.out.println("In Function");
> > > > >    
> > > > > Client client = new TransportClient()
> > > > > .addTransportAddress(new 
> > > > > 
> > > > > ```
> > > > > 
> > > > > InetSocketTransportAddress("localhost", 9200)); // This is where my  
> > > > > control is getting stuck,without any exceptions or errors.
> > > > > 
> > > > > ```
> > > > > System.out.println("Connected");
> > > > > //on ShutDown
> > > > > client.close();
> > > > > }
> > > > > 
> > > > > public static void main(String[] args) {
> > > > >    
> > > > > System.out.println("In Main Method");
> > > > > JavaES_Client jc = new JavaES_Client();
> > > > > System.out.println("Object Created");
> > > > > jc.function();
> > > > >    
> > > > > }
> > > > > 
> > > > > ```
> > > > > 
> > > > > }
> > > > > 
> > > > > On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:
> > > > > 
> > > > > > On Linux the file is /etc/hosts  
> > > > > > On Windows c:\windows\system32\drivers\etc\hosts
> > > > > > 
> > > > > > Open the file in text editor
> > > > > > 
> > > > > > Add following lines:  
> > > > > > 192.168.1.100 host1  
> > > > > > 192.168.1.101 host2
> > > > > > 
> > > > > > Make sure that 192.168.1.100/101 is the right IP address of the  
> > > > > > host1/host2
> > > > > > 
> > > > > > 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> > > > > > 
> > > > > > > Hi Georgi Ivanov,  
> > > > > > > yes,i am able to understand the Exception i.e.  
> > > > > > > UnresolvedAddressException,but you are telling that to make sure host1 and  
> > > > > > > host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> > > > > > > on Windows,for this can you give me the steps how to approach this.Sorry i  
> > > > > > > am new to this and am learning i am unable to get the proper example.Thanks  
> > > > > > > in advance for the help.
> > > > > > > 
> > > > > > > On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov  
> > > > > > > wrote:
> > > > > > > 
> > > > > > > > Well  
> > > > > > > > I think UnresolvedAddressException obviously means that your Java  
> > > > > > > > client can not resolve host1 and host2
> > > > > > > > 
> > > > > > > > make sure host1 and host2 are resolvable by adding entries to  
> > > > > > > > /etc/hosts ot wherever the file in on Windows
> > > > > > > > 
> > > > > > > > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> > > > > > > > 
> > > > > > > > > Hi,  
> > > > > > > > > I am Y.Venu,i am totally new to this elasticsearch,now i am  
> > > > > > > > > trying to communicate java elastisearch,i have gone through the  
> > > > > > > > > elasticsearch java api's
> > > > > > > > > 
> > > > > > > > > 1st i came across maven repositry.  
> > > > > > > > > i have created pom.xml in my eclipse and in the dependency tag  
> > > > > > > > > i have just placed the code that i found in maven repositry
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > i.e. 
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > 
> > > > > > > > > org.elasticsearch elasticsearch ${es.version}
> > > > > > > > > 
> > > > > > > > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> > > > > > > > > TransportClient.
> > > > > > > > > 
> > > > > > > > > main()  
> > > > > > > > > {  
> > > > > > > > > Client client = new TransportClient()  
> > > > > > > > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > > > > > > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > // on shutdown
> > > > > > > > > 
> > > > > > > > > client.close();
> > > > > > > > >       
> > > > > > > > > Settings settings = ImmutableSettings.settingsBuilder()
> > > > > > > > > .put("client.transport.sniff", true).build();
> > > > > > > > > TransportClient client1 = new TransportClient(settings);
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > 
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > After running this app javapplication,i am getting the errors like this
> > > > > > > > > 
> > > > > > > > > In Main Method  
> > > > > > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > > > > > > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> > > > > > > > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > > > > > > > INFO: [Mister Machine] loaded   
> > > > > > > > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > > > > > > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> > > > > > > > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > > > > > > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > > > > > > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> > > > > > > > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > > > > > > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> > > > > > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > > > > > > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > > > > > > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> > > > > > > > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > > > > > > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > > > > > > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> > > > > > > > > at ES\_Client.main(ES\_Client.java:64)  
> > > > > > > > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> > > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> > > > > > > > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > > > > > > ... 17 more  
> > > > > > > > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > > > > > > > at java.lang.Class.getDeclaredFields0(Native Method)  
> > > > > > > > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > > > > > > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> > > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> > > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > > > > > > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> > > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> > > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > > > > > > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > > > > > > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > > > > > > > ... 27 more  
> > > > > > > > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > > > > > > > at java.security.AccessController.doPrivileged(Native Method)  
> > > > > > > > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > > > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > > > > > > > ... 41 more
> > > > > > > > > 
> > > > > > > > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > > > > > > > 
> > > > > > > > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > > > > > > > 
> > > > > > > > > any basic application so that i can look and get some idea.
> > > > > > > > > 
> > > > > > > > > URGENT PLZ
> > > > > > > > > 
> > > > > > > > > Thanks in advance.
> > > > > > > > > 
> > > > > > > > > Regards Venu.Y
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > --
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > 
> > > > > > > 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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe)  
> > > > > > > .  
> > > > > > > To unsubscribe from this group and all its topics, send an email to  
> > > > > > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > To view this discussion on the web visit  
> > > > > > > [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com?utm_medium=email&utm_source=footer).
> > > > > > > 
> > > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > To view this discussion on the web visit  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .  
> > > > > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>. To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com?utm_medium=email&utm_source=footer) . 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/07952eeb-d71b-472e-ab19-7b1dd8427a42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07952eeb-d71b-472e-ab19-7b1dd8427a42%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 21, 2014, 11:28am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/16 "2014-03-21T11:28:48Z")

</div>

Works fine for me.

Either your elasticsearch is not running locally, or your cluster name is not vesseltrackerES or you have some firewall issues.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 21 mars 2014 à 12:02:20, Venu Krishna ([yvgk2010@gmail.com](mailto:yvgk2010@gmail.com)) a écrit:

Exceptions and Warnings when i run the above code.

Mar 21, 2014 4:29:53 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:29:57 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:29:58 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:02 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:03 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:07 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:08 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:12 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:13 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:17 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:18 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:22 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:23 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:27 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:28 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: No node available  
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
at org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
at org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
at org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
at JavaES\_Client.main(JavaES\_Client.java:82)

On Friday, March 21, 2014 3:48:44 PM UTC+5:30, David Pilato wrote:  
Do this:

public class JavaES\_Client {

```
private static Client client;

private static void buildClient() {
    Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();
    client = new TransportClient(settings)
            .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
}

public static void main(String[] args) {

    buildClient();

    SearchResponse response = client.prepareSearch().execute().actionGet();
    System.out.println("response.getHits().totalHits() = " + response.getHits().totalHits());
}

```

}

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com)) a écrit:

On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:  
you can find my elasticsearch window i.e overview window and browse window.  
my java code you can see below.

from these windows i think you can get what i am doing.  
i just create new indexes with type and their id simply .  
before this i din't created any cluster or any node e.t.c. ,from my knowledge i have not created,but from ES site i came to know that cluster will be created bydefault and node aswell,but i have not given any cluster name or any specific thing or nodes.

i think i am not making any complication about this.

but to be frank..i am moving here and there like a child to know what is happening.

Java Code

import java.net.InetSocketAddress;  
import java.util.HashSet;  
import java.util.Set;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.cluster.node.DiscoveryNode;  
import org.elasticsearch.common.settings.ImmutableSettings;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
Client client;
Set<String> hosts;

void function()
{
    //on StartUp
            System.out.println("In Function");
   
client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
   
   
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

 void connectES() {
    hosts = new HashSet<String>();
      hosts.add("locolhost");
    // hosts.add("host2.host1.mydomain.com"); // Make sure this resolvs to proper IP address
      Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();

      TransportClient transportClient = new TransportClient(settings);
      for (String host : this.hosts) {
    transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9200));
      }

      System.out.print("Connected to nodes : ");
      for (DiscoveryNode node : transportClient.connectedNodes()) {
    System.out.print(node.getName() + " , ");
      }
      System.out.println("");

      this.client = (Client) transportClient;
    }

public static void main(String[] args) {
   
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
// jc.function();
    jc.connectES();
   
}

```

}

On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:  
There is something wrong with your set-up

How many ES node s you have ?  
On which IP addresses are ES hosts listening ?

I understood you have 2 hosts , but it seems you have only one on your local machine .

This is the code (a bit modified) I am using at the moment

public void connectES() {  
Set hosts = new HashSet();  
hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to proper IP address  
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();

TransportClient transportClient = new TransportClient(settings);  
for (String host : this.hosts) {  
transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9300));  
}

System.out.print("Connected to nodes : ");  
for (DiscoveryNode node : transportClient.connectedNodes()) {  
System.out.print(node.getHostName() + " , ");  
}  
System.out.println("");

this.client = (Client) transportClient;  
}

On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:  
Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you told i have replaced 9200 with 9300 in the above code ,then i executed the application i am getting following exceptions.

Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Connected  
Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Thankyou

On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:  
Use port 9300

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

Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :

Thankyou for the reply.I am not getting any errors,but i am not able to connect to my elasticsearch using java.Here my code.

import java.net.InetSocketAddress;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
void function()
{
    //on StartUp
            System.out.println("In Function");
   
    Client client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9200)); // This is where my control is getting stuck,without any exceptions or errors.
   
   
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

public static void main(String[] args) {
   
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
    jc.function();
   
}

```

}

On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:  
On Linux the file is /etc/hosts  
On Windows c:\windows\system32\drivers\etc\hosts

Open the file in text editor

Add following lines:  
192.168.1.100 host1  
192.168.1.101 host2

Make sure that 192.168.1.100/101 is the right IP address of the host1/host2

2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):  
Hi Georgi Ivanov,  
yes,i am able to understand the Exception i.e. UnresolvedAddressException,but you are telling that to make sure host1 and host2 are resolved by adding entries to /etc/hosts to wherever the file in on Windows,for this can you give me the steps how to approach this.Sorry i am new to this and am learning i am unable to get the proper example.Thanks in advance for the help.

On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:  
Well  
I think UnresolvedAddressException obviously means that your Java client can not resolve host1 and host2

make sure host1 and host2 are resolvable by adding entries to /etc/hosts ot wherever the file in on Windows

On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:  
Hi,  
I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's

1st i came across maven repositry.  
i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry

```
         i.e. 

```

 org.elasticsearch elasticsearch ${es.version}

After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
TransportClient.

main()  
{  
Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9200));

```
     // on shutdown

        client.close();
       
     Settings settings = ImmutableSettings.settingsBuilder()
             .put("client.transport.sniff", true).build();
        TransportClient client1 = new TransportClient(settings);

```

}

After running this app javapplication,i am getting the errors like this

In Main Method  
Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
INFO: [Mister Machine] loaded []  
org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
at ES\_Client.main(ES\_Client.java:64)  
Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 17 more  
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at java.lang.Class.getDeclaredFields0(Native Method)  
at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
at java.lang.Class.getDeclaredFields(Unknown Source)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 27 more  
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 41 more

from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.

Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to elastic search.

any basic application so that i can look and get some idea.

URGENT PLZ

Thanks in advance.

Regards Venu.Y

--  
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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
To unsubscribe from this group and all its topics, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.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/07952eeb-d71b-472e-ab19-7b1dd8427a42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07952eeb-d71b-472e-ab19-7b1dd8427a42%40googlegroups.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/etPan.532c2270.6b8b4567.db6a%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.532c2270.6b8b4567.db6a%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 21, 2014, 2:39pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/18 "2014-03-21T14:39:56Z")

</div>

Haha! 🙂

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 21 mars 2014 à 14:27:26, Georgi Ivanov ([georgi.r.ivanov@gmail.com](mailto:georgi.r.ivanov@gmail.com)) a écrit:

His cluster name is not right , because it is my cluster name 🙂

If you did not change the cluster name , it is the default one : elasticsearch

Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "elasticsearch").build();

2014-03-21 12:28 GMT+01:00 David Pilato [david@pilato.fr](mailto:david@pilato.fr):  
Works fine for me.

Either your elasticsearch is not running locally, or your cluster name is not vesseltrackerES or you have some firewall issues.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 21 mars 2014 à 12:02:20, Venu Krishna ([yvgk2010@gmail.com](mailto:yvgk2010@gmail.com)) a écrit:

Exceptions and Warnings when i run the above code.

Mar 21, 2014 4:29:53 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:29:57 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:29:58 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:02 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:03 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:07 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:08 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:12 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:13 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:17 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:18 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:22 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:23 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:27 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 21, 2014 4:30:28 PM org.elasticsearch.client.transport  
WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: No node available  
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
at org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
at org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
at org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
at JavaES\_Client.main(JavaES\_Client.java:82)

On Friday, March 21, 2014 3:48:44 PM UTC+5:30, David Pilato wrote:  
Do this:

public class JavaES\_Client {

```
private static Client client;

private static void buildClient() {
    Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();
    client = new TransportClient(settings)
            .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
}

public static void main(String[] args) {

    buildClient();

    SearchResponse response = client.prepareSearch().execute().actionGet();
    System.out.println("response.getHits().totalHits() = " + response.getHits().totalHits());
}

```

}

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com)) a écrit:

On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:  
you can find my elasticsearch window i.e overview window and browse window.  
my java code you can see below.

from these windows i think you can get what i am doing.  
i just create new indexes with type and their id simply .  
before this i din't created any cluster or any node e.t.c. ,from my knowledge i have not created,but from ES site i came to know that cluster will be created bydefault and node aswell,but i have not given any cluster name or any specific thing or nodes.

i think i am not making any complication about this.

but to be frank..i am moving here and there like a child to know what is happening.

Java Code

import java.net.InetSocketAddress;  
import java.util.HashSet;  
import java.util.Set;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.cluster.node.DiscoveryNode;  
import org.elasticsearch.common.settings.ImmutableSettings;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
Client client;
Set<String> hosts;

void function()
{
    //on StartUp
            System.out.println("In Function");
   
client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
   
   
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

 void connectES() {
    hosts = new HashSet<String>();
      hosts.add("locolhost");
    // hosts.add("host2.host1.mydomain.com"); // Make sure this resolvs to proper IP address
      Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();

      TransportClient transportClient = new TransportClient(settings);
      for (String host : this.hosts) {
    transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9200));
      }

      System.out.print("Connected to nodes : ");
      for (DiscoveryNode node : transportClient.connectedNodes()) {
    System.out.print(node.getName() + " , ");
      }
      System.out.println("");

      this.client = (Client) transportClient;
    }

public static void main(String[] args) {
   
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
// jc.function();
    jc.connectES();
   
}

```

}

On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:  
There is something wrong with your set-up

How many ES node s you have ?  
On which IP addresses are ES hosts listening ?

I understood you have 2 hosts , but it seems you have only one on your local machine .

This is the code (a bit modified) I am using at the moment

public void connectES() {  
Set hosts = new HashSet();  
hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to proper IP address  
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();

TransportClient transportClient = new TransportClient(settings);  
for (String host : this.hosts) {  
transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9300));  
}

System.out.print("Connected to nodes : ");  
for (DiscoveryNode node : transportClient.connectedNodes()) {  
System.out.print(node.getHostName() + " , ");  
}  
System.out.println("");

this.client = (Client) transportClient;  
}

On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:  
Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you told i have replaced 9200 with 9300 in the above code ,then i executed the application i am getting following exceptions.

Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Connected  
Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Thankyou

On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:  
Use port 9300

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

Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :

Thankyou for the reply.I am not getting any errors,but i am not able to connect to my elasticsearch using java.Here my code.

import java.net.InetSocketAddress;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
void function()
{
    //on StartUp
            System.out.println("In Function");
   
    Client client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("localhost", 9200)); // This is where my control is getting stuck,without any exceptions or errors.
   
   
    System.out.println("Connected");
    //on ShutDown
    client.close();
}

public static void main(String[] args) {
   
    System.out.println("In Main Method");
    JavaES_Client jc = new JavaES_Client();
    System.out.println("Object Created");
    jc.function();
   
}

```

}

On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:  
On Linux the file is /etc/hosts  
On Windows c:\windows\system32\drivers\etc\hosts

Open the file in text editor

Add following lines:  
192.168.1.100 host1  
192.168.1.101 host2

Make sure that 192.168.1.100/101 is the right IP address of the host1/host2

2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):  
Hi Georgi Ivanov,  
yes,i am able to understand the Exception i.e. UnresolvedAddressException,but you are telling that to make sure host1 and host2 are resolved by adding entries to /etc/hosts to wherever the file in on Windows,for this can you give me the steps how to approach this.Sorry i am new to this and am learning i am unable to get the proper example.Thanks in advance for the help.

On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:  
Well  
I think UnresolvedAddressException obviously means that your Java client can not resolve host1 and host2

make sure host1 and host2 are resolvable by adding entries to /etc/hosts ot wherever the file in on Windows

On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:  
Hi,  
I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's

1st i came across maven repositry.  
i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry

```
         i.e. 

```

 org.elasticsearch elasticsearch ${es.version}

After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
TransportClient.

main()  
{  
Client client = new TransportClient()  
.addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
.addTransportAddress(new InetSocketTransportAddress("host2", 9200));

```
     // on shutdown

        client.close();
       
     Settings settings = ImmutableSettings.settingsBuilder()
             .put("client.transport.sniff", true).build();
        TransportClient client1 = new TransportClient(settings);

```

}

After running this app javapplication,i am getting the errors like this

In Main Method  
Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
INFO: [Mister Machine] loaded []  
org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
at ES\_Client.main(ES\_Client.java:64)  
Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 17 more  
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
at java.lang.Class.getDeclaredFields0(Native Method)  
at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
at java.lang.Class.getDeclaredFields(Unknown Source)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
... 27 more  
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.net.URLClassLoader$1.run(Unknown Source)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 41 more

from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.

Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to elastic search.

any basic application so that i can look and get some idea.

URGENT PLZ

Thanks in advance.

Regards Venu.Y

--  
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/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
To unsubscribe from this group and all its topics, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc5accc6-106b-485d-a4da-ad1efed9db74%40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e3b85b33-6203-4758-9788-2846e9d69b85%40googlegroups.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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/36600c42-5026-4bd7-a75c-069ed12e78f6%40googlegroups.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/07952eeb-d71b-472e-ab19-7b1dd8427a42%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07952eeb-d71b-472e-ab19-7b1dd8427a42%40googlegroups.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 a topic in the Google Groups "elasticsearch" group.  
To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/X6dmbQE7pFc/unsubscribe).  
To unsubscribe from this group and all its topics, 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/etPan.532c2270.6b8b4567.db6a%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.532c2270.6b8b4567.db6a%40MacBook-Air-de-David.local).

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/CAGKxwgkhYBvm\_K30LBc7kgH%3DB-iGfvCe9\_o1nJGPUgrm-1ZK7A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGKxwgkhYBvm_K30LBc7kgH%3DB-iGfvCe9_o1nJGPUgrm-1ZK7A%40mail.gmail.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/etPan.532c4f3c.74b0dc51.db6a%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.532c4f3c.74b0dc51.db6a%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 22, 2014, 8:41am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/19 "2014-03-22T08:41:06Z")

</div>

yes,due to my ignorance i have blindly copied any run the code,but now i  
have modified it to the default clustername.

import java.net.InetSocketAddress;  
import java.util.HashSet;  
import java.util.Set;

import org.elasticsearch.action.search.SearchResponse;  
import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.cluster.node.DiscoveryNode;  
import org.elasticsearch.common.settings.ImmutableSettings;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class JavaES\_Client {

```
private static Client client;

private static void buildClient() {
    Settings settings = 

```

ImmutableSettings.settingsBuilder().put("cluster.name",  
"elasticsearch").build();  
client = new TransportClient(settings)  
.addTransportAddress(new  
InetSocketTransportAddress("localhost", 9200));  
}

```
public static void main(String[] args) {

    buildClient();

    SearchResponse response = 

```

client.prepareSearch().execute().actionGet();  
System.out.println("response.getHits().totalHits() = " +  
response.getHits().totalHits());  
}

}

On Friday, March 21, 2014 8:09:56 PM UTC+5:30, David Pilato wrote:

> Haha! 🙂
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 14:27:26, Georgi Ivanov ([georgi....@gmail.com](mailto:georgi....@gmail.com)\<javascript:\>)  
> a écrit:
> 
> His cluster name is not right , because it is my cluster name 🙂
> 
> If you did not change the cluster name , it is the default one :  
> elasticsearch
> 
> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name",  
> "elasticsearch").build();
> 
> 2014-03-21 12:28 GMT+01:00 David Pilato \<[da...@pilato.fr](mailto:da...@pilato.fr) \<javascript:\>\>:
> 
> Works fine for me.
> 
> Either your elasticsearch is not running locally, or your cluster name is  
> not vesseltrackerES or you have some firewall issues.
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 12:02:20, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Exceptions and Warnings when i run the above code.
> 
> Mar 21, 2014 4:29:53 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:29:57 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:29:58 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:02 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:03 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:07 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:08 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:12 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:13 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:17 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:18 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:22 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:23 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:27 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:28 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Exception in thread "main"  
> org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> available  
> at  
> org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
> at  
> org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
> at  
> org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
> at  
> org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
> at  
> org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
> at  
> org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
> at JavaES\_Client.main(JavaES\_Client.java:82)
> 
> On Friday, March 21, 2014 3:48:44 PM UTC+5:30, David Pilato wrote:
> 
> Do this:
> 
> public class JavaES\_Client {
> 
> ```
> private static Client client;
> 
> private static void buildClient() {
> Settings settings = ImmutableSettings.settingsBuilder().put("
> 
> ```
> 
> cluster.name", "vesseltrackerES").build();  
> client = new TransportClient(settings)  
> .addTransportAddress(new  
> InetSocketTransportAddress("localhost", 9300));  
> }
> 
> ```
> public static void main(String[] args) {
> 
> buildClient();
> 
> SearchResponse response = 
> 
> ```
> 
> client.prepareSearch().execute().actionGet();  
> System.out.println("response.getHits().totalHits() = " +  
> response.getHits().totalHits());  
> }
> 
> }
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com)) a écrit:
> 
> On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:
> 
> you can find my elasticsearch window i.e overview window and browse window.  
> my java code you can see below.
> 
> from these windows i think you can get what i am doing.  
> i just create new indexes with type and their id simply .  
> before this i din't created any cluster or any node e.t.c. ,from my  
> knowledge i have not created,but from ES site i came to know that cluster  
> will be created bydefault and node aswell,but i have not given any cluster  
> name or any specific thing or nodes.
> 
> i think i am not making any complication about this.
> 
> but to be frank..i am moving here and there like a child to know what is  
> happening.
> 
> Java Code
> 
> import java.net.InetSocketAddress;  
> import java.util.HashSet;  
> import java.util.Set;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.cluster.node.DiscoveryNode;  
> import org.elasticsearch.common.settings.ImmutableSettings;  
> import org.elasticsearch.common.settings.Settings;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> Client client;
> Set<String> hosts;
> 
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>    
> client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 
> 
> ```
> 
> 9300));
> 
> ```
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> void connectES() {
> hosts = new HashSet<String>();
> hosts.add("locolhost");
> // hosts.add("host2.host1.mydomain.com"); // Make sure this 
> 
> ```
> 
> resolvs to proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("  
> cluster.name", "vesseltrackerES").build();
> 
> ```
> TransportClient transportClient = new TransportClient(settings);
> for (String host : this.hosts) {
> transportClient = transportClient.addTransportAddress(new 
> 
> ```
> 
> InetSocketTransportAddress(host, 9200));  
> }
> 
> ```
> System.out.print("Connected to nodes : ");
> for (DiscoveryNode node : transportClient.connectedNodes()) {
> System.out.print(node.getName() + " , ");
> }
> System.out.println("");
> 
> this.client = (Client) transportClient;
> }
> 
> public static void main(String[] args) {
>    
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> // jc.function();
> jc.connectES();
>    
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:
> 
> There is something wrong with your set-up
> 
> How many ES node s you have ?  
> On which IP addresses are ES hosts listening ?
> 
> I understood you have 2 hosts , but it seems you have only one on your  
> local machine .
> 
> This is the code (a bit modified) I am using at the moment
> 
> public void connectES() {  
> Set hosts = new HashSet();  
> hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
> hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to  
> proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("  
> cluster.name", "vesseltrackerES").build();
> 
> TransportClient transportClient = new TransportClient(settings);  
> for (String host : this.hosts) {  
> transportClient = transportClient.addTransportAddress(new  
> InetSocketTransportAddress(host, 9300));  
> }
> 
> System.out.print("Connected to nodes : ");  
> for (DiscoveryNode node : transportClient.connectedNodes()) {  
> System.out.print(node.getHostName() + " , ");  
> }  
> System.out.println("");
> 
> this.client = (Client) transportClient;  
> }
> 
> On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:
> 
> Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you  
> told i have replaced 9200 with 9300 in the above code ,then i executed the  
> application i am getting following exceptions.
> 
> Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/  
> 127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Connected  
> Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/  
> 127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/  
> 127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Thankyou
> 
> On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:
> 
> Use port 9300
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :
> 
> Thankyou for the reply.I am not getting any errors,but i am not able to  
> connect to my elasticsearch using java.Here my code.
> 
> import java.net.InetSocketAddress;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>    
> Client client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 
> 
> ```
> 
> 9200)); // This is where my control is getting stuck,without any  
> exceptions or errors.
> 
> ```
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> public static void main(String[] args) {
>    
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> jc.function();
>    
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:
> 
> On Linux the file is /etc/hosts  
> On Windows c:\windows\system32\drivers\etc\hosts
> 
> Open the file in text editor
> 
> Add following lines:  
> 192.168.1.100 host1  
> 192.168.1.101 host2
> 
> Make sure that 192.168.1.100/101 is the right IP address of the  
> host1/host2
> 
> 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> 
> Hi Georgi Ivanov,  
> yes,i am able to understand the Exception i.e.  
> UnresolvedAddressException,but you are telling that to make sure host1 and  
> host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> on Windows,for this can you give me the steps how to approach this.Sorry i  
> am new to this and am learning i am unable to get the proper example.Thanks  
> in advance for the help.
> 
> On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:
> 
> Well  
> I think UnresolvedAddressException obviously means that your Java client  
> can not resolve host1 and host2
> 
> make sure host1 and host2 are resolvable by adding entries to /etc/hosts  
> ot wherever the file in on Windows
> 
> On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> 
> Hi,  
> I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
> to communicate java elastisearch,i have gone through the elasticsearch java  
> api's
> 
> 1st i came across maven repositry.  
> i have created pom.xml in my eclipse and in the dependency tag i have  
> just placed the code that i found in maven repositry
> 
> ```
> i.e. 
> 
> ```
> 
> org.elasticsearch elasticsearch ${es.version}
> 
> After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> TransportClient.
> 
> main()  
> {  
> Client client = new TransportClient()  
> .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> 
> ```
> // on shutdown
> 
> client.close();
>       
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("client.transport.sniff", true).build();
> TransportClient client1 = new TransportClient(settings);
> 
> ```
> 
> }
> 
> After running this app javapplication,i am getting the errors like this
> 
> In Main Method  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> INFO: [Mister Machine] loaded   
> org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> at ES\_Client.main(ES\_Client.java:64)  
> Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 17 more  
> Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at java.lang.Class.getDeclaredFields0(Native Method)  
> at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> at java.lang.Class.getDeclaredFields(Unknown Source)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 27 more  
> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.security.AccessController.doPrivileged(Native Method)  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> ... 41 more
> 
> from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> 
> Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.\<
> 
> ...

--  
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/680a66b7-a306-4370-aab4-49e04cd042c6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/680a66b7-a306-4370-aab4-49e04cd042c6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 22, 2014, 8:44am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/20 "2014-03-22T08:44:03Z")

</div>

now after execution ,i am seeing

Mar 22, 2014 2:12:55 PM org.elasticsearch.client.transport  
WARNING: [Shingen Harada] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Exception in thread "main"  
org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at  
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
at  
org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
at  
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
at  
org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
at  
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
at  
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
at JavaES\_Client.main(JavaES\_Client.java:82)

On Friday, March 21, 2014 8:09:56 PM UTC+5:30, David Pilato wrote:

> Haha! 🙂
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 14:27:26, Georgi Ivanov ([georgi....@gmail.com](mailto:georgi....@gmail.com)\<javascript:\>)  
> a écrit:
> 
> His cluster name is not right , because it is my cluster name 🙂
> 
> If you did not change the cluster name , it is the default one :  
> elasticsearch
> 
> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name",  
> "elasticsearch").build();
> 
> 2014-03-21 12:28 GMT+01:00 David Pilato \<[da...@pilato.fr](mailto:da...@pilato.fr) \<javascript:\>\>:
> 
> Works fine for me.
> 
> Either your elasticsearch is not running locally, or your cluster name is  
> not vesseltrackerES or you have some firewall issues.
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 12:02:20, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Exceptions and Warnings when i run the above code.
> 
> Mar 21, 2014 4:29:53 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:29:57 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:29:58 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:02 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:03 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:07 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:08 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:12 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:13 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:17 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:18 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:22 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:23 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:27 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:28 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException:  
> [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Exception in thread "main"  
> org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> available  
> at  
> org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
> at  
> org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
> at  
> org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
> at  
> org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
> at  
> org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
> at  
> org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
> at JavaES\_Client.main(JavaES\_Client.java:82)
> 
> On Friday, March 21, 2014 3:48:44 PM UTC+5:30, David Pilato wrote:
> 
> Do this:
> 
> public class JavaES\_Client {
> 
> ```
> private static Client client;
> 
> private static void buildClient() {
> Settings settings = ImmutableSettings.settingsBuilder().put("
> 
> ```
> 
> cluster.name", "vesseltrackerES").build();  
> client = new TransportClient(settings)  
> .addTransportAddress(new  
> InetSocketTransportAddress("localhost", 9300));  
> }
> 
> ```
> public static void main(String[] args) {
> 
> buildClient();
> 
> SearchResponse response = 
> 
> ```
> 
> client.prepareSearch().execute().actionGet();  
> System.out.println("response.getHits().totalHits() = " +  
> response.getHits().totalHits());  
> }
> 
> }
> 
> ```
> -- 
> 
> ```
> 
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com)) a écrit:
> 
> On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:
> 
> you can find my elasticsearch window i.e overview window and browse window.  
> my java code you can see below.
> 
> from these windows i think you can get what i am doing.  
> i just create new indexes with type and their id simply .  
> before this i din't created any cluster or any node e.t.c. ,from my  
> knowledge i have not created,but from ES site i came to know that cluster  
> will be created bydefault and node aswell,but i have not given any cluster  
> name or any specific thing or nodes.
> 
> i think i am not making any complication about this.
> 
> but to be frank..i am moving here and there like a child to know what is  
> happening.
> 
> Java Code
> 
> import java.net.InetSocketAddress;  
> import java.util.HashSet;  
> import java.util.Set;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.cluster.node.DiscoveryNode;  
> import org.elasticsearch.common.settings.ImmutableSettings;  
> import org.elasticsearch.common.settings.Settings;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> Client client;
> Set<String> hosts;
> 
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>    
> client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 
> 
> ```
> 
> 9300));
> 
> ```
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> void connectES() {
> hosts = new HashSet<String>();
> hosts.add("locolhost");
> // hosts.add("host2.host1.mydomain.com"); // Make sure this 
> 
> ```
> 
> resolvs to proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("  
> cluster.name", "vesseltrackerES").build();
> 
> ```
> TransportClient transportClient = new TransportClient(settings);
> for (String host : this.hosts) {
> transportClient = transportClient.addTransportAddress(new 
> 
> ```
> 
> InetSocketTransportAddress(host, 9200));  
> }
> 
> ```
> System.out.print("Connected to nodes : ");
> for (DiscoveryNode node : transportClient.connectedNodes()) {
> System.out.print(node.getName() + " , ");
> }
> System.out.println("");
> 
> this.client = (Client) transportClient;
> }
> 
> public static void main(String[] args) {
>    
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> // jc.function();
> jc.connectES();
>    
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:
> 
> There is something wrong with your set-up
> 
> How many ES node s you have ?  
> On which IP addresses are ES hosts listening ?
> 
> I understood you have 2 hosts , but it seems you have only one on your  
> local machine .
> 
> This is the code (a bit modified) I am using at the moment
> 
> public void connectES() {  
> Set hosts = new HashSet();  
> hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
> hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to  
> proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("  
> cluster.name", "vesseltrackerES").build();
> 
> TransportClient transportClient = new TransportClient(settings);  
> for (String host : this.hosts) {  
> transportClient = transportClient.addTransportAddress(new  
> InetSocketTransportAddress(host, 9300));  
> }
> 
> System.out.print("Connected to nodes : ");  
> for (DiscoveryNode node : transportClient.connectedNodes()) {  
> System.out.print(node.getHostName() + " , ");  
> }  
> System.out.println("");
> 
> this.client = (Client) transportClient;  
> }
> 
> On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:
> 
> Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you  
> told i have replaced 9200 with 9300 in the above code ,then i executed the  
> application i am getting following exceptions.
> 
> Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/  
> 127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Connected  
> Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/  
> 127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for  
> [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/  
> 127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Thankyou
> 
> On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:
> 
> Use port 9300
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :
> 
> Thankyou for the reply.I am not getting any errors,but i am not able to  
> connect to my elasticsearch using java.Here my code.
> 
> import java.net.InetSocketAddress;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>    
> Client client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 
> 
> ```
> 
> 9200)); // This is where my control is getting stuck,without any  
> exceptions or errors.
> 
> ```
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> public static void main(String[] args) {
>    
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> jc.function();
>    
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:
> 
> On Linux the file is /etc/hosts  
> On Windows c:\windows\system32\drivers\etc\hosts
> 
> Open the file in text editor
> 
> Add following lines:  
> 192.168.1.100 host1  
> 192.168.1.101 host2
> 
> Make sure that 192.168.1.100/101 is the right IP address of the  
> host1/host2
> 
> 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):
> 
> Hi Georgi Ivanov,  
> yes,i am able to understand the Exception i.e.  
> UnresolvedAddressException,but you are telling that to make sure host1 and  
> host2 are resolved by adding entries to /etc/hosts to wherever the file in  
> on Windows,for this can you give me the steps how to approach this.Sorry i  
> am new to this and am learning i am unable to get the proper example.Thanks  
> in advance for the help.
> 
> On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:
> 
> Well  
> I think UnresolvedAddressException obviously means that your Java client  
> can not resolve host1 and host2
> 
> make sure host1 and host2 are resolvable by adding entries to /etc/hosts  
> ot wherever the file in on Windows
> 
> On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> 
> Hi,  
> I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
> to communicate java elastisearch,i have gone through the elasticsearch java  
> api's
> 
> 1st i came across maven repositry.  
> i have created pom.xml in my eclipse and in the dependency tag i have  
> just placed the code that i found in maven repositry
> 
> ```
> i.e. 
> 
> ```
> 
> org.elasticsearch elasticsearch ${es.version}
> 
> After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> TransportClient.
> 
> main()  
> {  
> Client client = new TransportClient()  
> .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> 
> ```
> // on shutdown
> 
> client.close();
>       
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("client.transport.sniff", true).build();
> TransportClient client1 = new TransportClient(settings);
> 
> ```
> 
> }
> 
> After running this app javapplication,i am getting the errors like this
> 
> In Main Method  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> INFO: [Mister Machine] loaded   
> org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> at ES\_Client.main(ES\_Client.java:64)  
> Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 17 more  
> Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at java.lang.Class.getDeclaredFields0(Native Method)  
> at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> at java.lang.Class.getDeclaredFields(Unknown Source)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 27 more  
> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.security.AccessController.doPrivileged(Native Method)  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> ... 41 more
> 
> from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> 
> Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.\<
> 
> ...

--  
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/4a7553a3-276e-4b4a-b142-cb8d849569df%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4a7553a3-276e-4b4a-b142-cb8d849569df%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 22, 2014, 12:17pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/21 "2014-03-22T12:17:32Z")

</div>

Either your elasticsearch is not running locally, or your cluster name is not elasticsearch or you have some firewall issues.

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

Le 22 mars 2014 à 09:44, Venu Krishna [yvgk2010@gmail.com](mailto:yvgk2010@gmail.com) a écrit :

now after execution ,i am seeing

Mar 22, 2014 2:12:55 PM org.elasticsearch.client.transport  
WARNING: [Shingen Harada] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: No node available  
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
at org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
at org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
at org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
at JavaES\_Client.main(JavaES\_Client.java:82)

> On Friday, March 21, 2014 8:09:56 PM UTC+5:30, David Pilato wrote:  
> Haha! 🙂
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr
> 
> Le 21 mars 2014 à 14:27:26, Georgi Ivanov ([georgi....@gmail.com](mailto:georgi....@gmail.com)) a écrit:
> 
> His cluster name is not right , because it is my cluster name 🙂
> 
> If you did not change the cluster name , it is the default one : elasticsearch
> 
> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "elasticsearch").build();
> 
> 2014-03-21 12:28 GMT+01:00 David Pilato [da...@pilato.fr](mailto:da...@pilato.fr):  
> Works fine for me.
> 
> Either your elasticsearch is not running locally, or your cluster name is not vesseltrackerES or you have some firewall issues.
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr
> 
> Le 21 mars 2014 à 12:02:20, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com)) a écrit:
> 
> Exceptions and Warnings when i run the above code.
> 
> Mar 21, 2014 4:29:53 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:29:57 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:29:58 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:02 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:03 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:07 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:08 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:12 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:13 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:17 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:18 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:22 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:23 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:27 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 21, 2014 4:30:28 PM org.elasticsearch.client.transport  
> WARNING: [Woodgod] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: No node available  
> at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
> at org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
> at org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
> at org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
> at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
> at org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
> at JavaES\_Client.main(JavaES\_Client.java:82)
> 
> On Friday, March 21, 2014 3:48:44 PM UTC+5:30, David Pilato wrote:  
> Do this:
> 
> public class JavaES\_Client {
> 
> ```
> private static Client client;
> 
> private static void buildClient() {
> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();
> client = new TransportClient(settings)
> .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
> }
> 
> public static void main(String[] args) {
> 
> buildClient();
> 
> SearchResponse response = client.prepareSearch().execute().actionGet();
> System.out.println("response.getHits().totalHits() = " + response.getHits().totalHits());
> }
> 
> ```
> 
> }
> 
> --  
> David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> @dadoonet | @elasticsearchfr
> 
> Le 21 mars 2014 à 11:10:56, Venu Krishna ([yvgk...@gmail.com](mailto:yvgk...@gmail.com)) a écrit:
> 
> On Friday, March 21, 2014 3:39:36 PM UTC+5:30, Venu Krishna wrote:  
> you can find my elasticsearch window i.e overview window and browse window.  
> my java code you can see below.
> 
> from these windows i think you can get what i am doing.  
> i just create new indexes with type and their id simply .  
> before this i din't created any cluster or any node e.t.c. ,from my knowledge i have not created,but from ES site i came to know that cluster will be created bydefault and node aswell,but i have not given any cluster name or any specific thing or nodes.
> 
> i think i am not making any complication about this.
> 
> but to be frank..i am moving here and there like a child to know what is happening.
> 
> Java Code
> 
> import java.net.InetSocketAddress;  
> import java.util.HashSet;  
> import java.util.Set;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.cluster.node.DiscoveryNode;  
> import org.elasticsearch.common.settings.ImmutableSettings;  
> import org.elasticsearch.common.settings.Settings;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> Client client;
> Set<String> hosts;
> 
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>    
> client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
>    
>    
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> void connectES() {
> hosts = new HashSet<String>();
> hosts.add("locolhost");
> // hosts.add("host2.host1.mydomain.com"); // Make sure this resolvs to proper IP address
> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();
> 
> TransportClient transportClient = new TransportClient(settings);
> for (String host : this.hosts) {
> transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9200));
> }
> 
> System.out.print("Connected to nodes : ");
> for (DiscoveryNode node : transportClient.connectedNodes()) {
> System.out.print(node.getName() + " , ");
> }
> System.out.println("");
> 
> this.client = (Client) transportClient;
> }
> 
> public static void main(String[] args) {
>    
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> // jc.function();
> jc.connectES();
>    
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 8:41:08 PM UTC+5:30, Georgi Ivanov wrote:  
> There is something wrong with your set-up
> 
> How many ES node s you have ?  
> On which IP addresses are ES hosts listening ?
> 
> I understood you have 2 hosts , but it seems you have only one on your local machine .
> 
> This is the code (a bit modified) I am using at the moment
> 
> public void connectES() {  
> Set hosts = new HashSet();  
> hosts.add("[host1.mydomain.com](http://host1.mydomain.com)");  
> hosts.add("[host2.host1.mydomain.com](http://host2.host1.mydomain.com)"); // Make sure this resolvs to proper IP address  
> Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "vesseltrackerES").build();
> 
> TransportClient transportClient = new TransportClient(settings);  
> for (String host : this.hosts) {  
> transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(host, 9300));  
> }
> 
> System.out.print("Connected to nodes : ");  
> for (DiscoveryNode node : transportClient.connectedNodes()) {  
> System.out.print(node.getHostName() + " , ");  
> }  
> System.out.println("");
> 
> this.client = (Client) transportClient;  
> }
> 
> On Thursday, March 20, 2014 2:51:50 PM UTC+1, Venu Krishna wrote:  
> Actually this is my elasticsearch index [http://localhost:9200/](http://localhost:9200/), as you told i have replaced 9200 with 9300 in the above code ,then i executed the application i am getting following exceptions.
> 
> Mar 20, 2014 7:17:45 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Connected  
> Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Mar 20, 2014 7:17:50 PM org.elasticsearch.client.transport  
> WARNING: [Bailey, Gailyn] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected
> 
> Thankyou
> 
> On Thursday, March 20, 2014 7:12:14 PM UTC+5:30, David Pilato wrote:  
> Use port 9300
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 20 mars 2014 à 14:34, Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com) a écrit :
> 
> Thankyou for the reply.I am not getting any errors,but i am not able to connect to my elasticsearch using java.Here my code.
> 
> import java.net.InetSocketAddress;
> 
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class JavaES\_Client {
> 
> ```
> void function()
> {
> //on StartUp
> System.out.println("In Function");
>    
> Client client = new TransportClient()
> .addTransportAddress(new InetSocketTransportAddress("localhost", 9200)); // This is where my control is getting stuck,without any exceptions or errors.
>    
>    
> System.out.println("Connected");
> //on ShutDown
> client.close();
> }
> 
> public static void main(String[] args) {
>    
> System.out.println("In Main Method");
> JavaES_Client jc = new JavaES_Client();
> System.out.println("Object Created");
> jc.function();
>    
> }
> 
> ```
> 
> }
> 
> On Thursday, March 20, 2014 2:20:25 PM UTC+5:30, Georgi Ivanov wrote:  
> On Linux the file is /etc/hosts  
> On Windows c:\windows\system32\drivers\etc\hosts
> 
> Open the file in text editor
> 
> Add following lines:  
> 192.168.1.100 host1  
> 192.168.1.101 host2
> 
> Make sure that 192.168.1.100/101 is the right IP address of the host1/host2
> 
> 2014-03-20 8:35 GMT+01:00 Venu Krishna [yvgk...@gmail.com](mailto:yvgk...@gmail.com):  
> Hi Georgi Ivanov,  
> yes,i am able to understand the Exception i.e. UnresolvedAddressException,but you are telling that to make sure host1 and host2 are resolved by adding entries to /etc/hosts to wherever the file in on Windows,for this can you give me the steps how to approach this.Sorry i am new to this and am learning i am unable to get the proper example.Thanks in advance for the help.
> 
> On Thursday, March 20, 2014 2:36:10 AM UTC+5:30, Georgi Ivanov wrote:  
> Well  
> I think UnresolvedAddressException obviously means that your Java client can not resolve host1 and host2
> 
> make sure host1 and host2 are resolvable by adding entries to /etc/hosts ot wherever the file in on Windows
> 
> On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:  
> Hi,  
> I am Y.Venu,i am totally new to this elasticsearch,now i am trying to communicate java elastisearch,i have gone through the elasticsearch java api's
> 
> 1st i came across maven repositry.  
> i have created pom.xml in my eclipse and in the dependency tag i have just placed the code that i found in maven repositry
> 
> ```
> i.e. 
> 
> ```
> 
> org.elasticsearch elasticsearch ${es.version}
> 
> After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> TransportClient.
> 
> main()  
> {  
> Client client = new TransportClient()  
> .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> 
> ```
> // on shutdown
> 
> client.close();
>       
> Settings settings = ImmutableSettings.settingsBuilder()
> .put("client.transport.sniff", true).build();
> TransportClient client1 = new TransportClient(settings);
> 
> ```
> 
> }
> 
> After running this app javapplication,i am getting the errors like this
> 
> In Main Method  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> INFO: [Mister Machine] loaded   
> org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> at ES\_Client.main(ES\_Client.java:64)  
> Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 17 more  
> Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> at java.lang.Class.getDeclaredFields0(Native Method)  
> at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> at java.lang.Class.getDeclaredFields(Unknown Source)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> ... 27 more  
> Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.net.URLClassLoader$1.run(Unknown Source)  
> at java.security.AccessController.doPrivileged(Native Method)  
> at java.net.URLClassLoader.findClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> at java.lang.ClassLoader.loadClass(Unknown Source)  
> ... 41 more
> 
> from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> 
> Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.\<  
> ...

--  
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/4a7553a3-276e-4b4a-b142-cb8d849569df%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4a7553a3-276e-4b4a-b142-cb8d849569df%40googlegroups.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/D713809F-2AB0-422A-A05B-59DCAA37745B%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/D713809F-2AB0-422A-A05B-59DCAA37745B%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [March 22, 2014, 11:02pm UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/23 "2014-03-22T23:02:23Z")

</div>

On Sat, Mar 22, 2014 at 1:46 PM, Georgi Ivanov [georgi.r.ivanov@gmail.com](mailto:georgi.r.ivanov@gmail.com)wrote:

> I still see port 9200.  
> Several times we said this must be 9300 .
> 
> As master Yoda would say : Concentrate you must !
> 
> :))
> 
> On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> 
> > Hi,  
> > I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
> > to communicate java elastisearch,i have gone through the elasticsearch java  
> > api's
> > 
> > 1st i came across maven repositry.  
> > i have created pom.xml in my eclipse and in the dependency tag i have  
> > just placed the code that i found in maven repositry
> > 
> > ```
> > i.e.
> > 
> > ```
> > 
> > org.elasticsearch elasticsearch ${es.version}
> > 
> > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> > TransportClient.
> > 
> > main()  
> > {  
> > Client client = new TransportClient()  
> > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > 
> > ```
> > // on shutdown
> > 
> > client.close();
> >   
> > Settings settings = ImmutableSettings.settingsBuilder()
> > .put("client.transport.sniff", true).build();
> > TransportClient client1 = new TransportClient(settings);
> > 
> > ```
> > 
> > }
> > 
> > After running this app javapplication,i am getting the errors like this
> > 
> > In Main Method  
> > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > INFO: [Mister Machine] loaded   
> > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> > at ES\_Client.main(ES\_Client.java:64)  
> > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > ... 17 more  
> > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at java.lang.Class.getDeclaredFields0(Native Method)  
> > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > ... 27 more  
> > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > at java.net.URLClassLoader$1.run(Unknown Source)  
> > at java.net.URLClassLoader$1.run(Unknown Source)  
> > at java.security.AccessController.doPrivileged(Native Method)  
> > at java.net.URLClassLoader.findClass(Unknown Source)  
> > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > ... 41 more
> > 
> > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > 
> > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > 
> > any basic application so that i can look and get some idea.
> > 
> > URGENT PLZ
> > 
> > Thanks in advance.
> > 
> > Regards Venu.Y
> > 
> > --  
> > 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/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

How are you running the code? If it is a java app have you specified all  
the jar in the path?

--  
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/CAOT3TWrb3K5V%2BzEKGvMsSTF250HHWZbSRQqxS8DLCY1cW8\_U6g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAOT3TWrb3K5V%2BzEKGvMsSTF250HHWZbSRQqxS8DLCY1cW8_U6g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 24, 2014, 9:04am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/24 "2014-03-24T09:04:26Z")

</div>

yes david,i have already done wat you have suggested me.

private static void buildClient() {  
Settings settings =  
ImmutableSettings.settingsBuilder().put("cluster.name",  
"elasticsearch").build();  
client = new TransportClient(settings)  
.addTransportAddress(new  
InetSocketTransportAddress("localhost", 9300));  
}

```
public static void main(String[] args) {

    buildClient();

    SearchResponse response = 

```

client.prepareSearch().execute().actionGet();  
System.out.println("response.getHits().totalHits() = " +  
response.getHits().totalHits());  
}

but when i execute i am getting o/p like :

Mar 24, 2014 2:29:06 PM org.elasticsearch.client.transport  
WARNING: [Microchip] failed to get node info for  
[#transport#-1][inet[localhost/127.0.0.1:9300]]  
org.elasticsearch.transport.NodeDisconnectedException:  
[inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected

Exception in thread "main"  
org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at  
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:139)  
at  
org.elasticsearch.client.transport.support.InternalTransportClient.search(InternalTransportClient.java:238)  
at  
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:300)  
at  
org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:579)  
at  
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)  
at  
org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)  
at JavaES\_Client.main(JavaES\_Client.java:82)

Q)Actually why i am putting port 9200?

Ans: my elasticsearch url index is with port 9200,so i am trying to put  
9200 in the place of 9300,but you initiated me to 9300.

is there any reason for 9300?

On Sunday, March 23, 2014 2:16:02 AM UTC+5:30, Georgi Ivanov wrote:

> I still see port 9200.  
> Several times we said this must be 9300 .
> 
> As master Yoda would say : Concentrate you must !
> 
> :))
> 
> On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> 
> > Hi,  
> > I am Y.Venu,i am totally new to this elasticsearch,now i am trying  
> > to communicate java elastisearch,i have gone through the elasticsearch java  
> > api's
> > 
> > 1st i came across maven repositry.  
> > i have created pom.xml in my eclipse and in the dependency tag i have  
> > just placed the code that i found in maven repositry
> > 
> > ```
> > i.e.  
> > 
> > ```
> > 
> > org.elasticsearch elasticsearch ${es.version}
> > 
> > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.  
> > TransportClient.
> > 
> > main()  
> > {  
> > Client client = new TransportClient()  
> > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > 
> > ```
> > // on shutdown
> > 
> > client.close();
> >   
> > Settings settings = ImmutableSettings.settingsBuilder()
> > .put("client.transport.sniff", true).build();
> > TransportClient client1 = new TransportClient(settings);
> > 
> > ```
> > 
> > }
> > 
> > After running this app javapplication,i am getting the errors like this
> > 
> > In Main Method  
> > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...  
> > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > INFO: [Mister Machine] loaded   
> > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)  
> > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)  
> > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)  
> > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)  
> > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)  
> > at ES\_Client.main(ES\_Client.java:64)  
> > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)  
> > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > ... 17 more  
> > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > at java.lang.Class.getDeclaredFields0(Native Method)  
> > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)  
> > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)  
> > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > ... 27 more  
> > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > at java.net.URLClassLoader$1.run(Unknown Source)  
> > at java.net.URLClassLoader$1.run(Unknown Source)  
> > at java.security.AccessController.doPrivileged(Native Method)  
> > at java.net.URLClassLoader.findClass(Unknown Source)  
> > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > ... 41 more
> > 
> > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > 
> > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > 
> > any basic application so that i can look and get some idea.
> > 
> > URGENT PLZ
> > 
> > Thanks in advance.
> > 
> > Regards Venu.Y

--  
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/0cee1075-2b4e-4d01-9d65-200a6ce29408%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0cee1075-2b4e-4d01-9d65-200a6ce29408%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Venu\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/b4bc9f/32.png) [@Venu\_Krishna](https://discuss.elastic.co/u/Venu_Krishna)\
**Post date:** [March 24, 2014, 9:10am UTC](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375/25 "2014-03-24T09:10:31Z")

</div>

Hi, i have added the respective jars to my project in eclipse,but i have  
not set any path.

On Sunday, March 23, 2014 4:32:23 AM UTC+5:30, Mo wrote:

> On Sat, Mar 22, 2014 at 1:46 PM, Georgi Ivanov \<[georgi....@gmail.com](mailto:georgi....@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I still see port 9200.  
> > Several times we said this must be 9300 .
> > 
> > As master Yoda would say : Concentrate you must !
> > 
> > :))
> > 
> > On Friday, March 14, 2014 1:47:02 PM UTC+1, Venu Krishna wrote:
> > 
> > > Hi,  
> > > I am Y.Venu,i am totally new to this elasticsearch,now i am  
> > > trying to communicate java elastisearch,i have gone through the  
> > > elasticsearch java api's
> > > 
> > > 1st i came across maven repositry.  
> > > i have created pom.xml in my eclipse and in the dependency tag i  
> > > have just placed the code that i found in maven repositry
> > > 
> > > ```
> > > i.e.  
> > > 
> > > ```
> > > 
> > > org.elasticsearch
> > > 
> > > ```
> > > <artifactId>elasticsearch</artifactId>
> > > 
> > > <version>${es.version}</version>
> > > 
> > > ```
> > > 
> > > After that i have created one class with the main method and i copied and placed the code that i found in the client api of elasticsearch i.e.
> > > 
> > > TransportClient.
> > > 
> > > main()  
> > > {  
> > > Client client = new TransportClient()  
> > > .addTransportAddress(new InetSocketTransportAddress("host1", 9200))  
> > > .addTransportAddress(new InetSocketTransportAddress("host2", 9200));
> > > 
> > > ```
> > > // on shutdown
> > > 
> > > client.close();
> > >   
> > > Settings settings = ImmutableSettings.settingsBuilder()
> > > .put("client.transport.sniff", true).build();
> > > TransportClient client1 = new TransportClient(settings);
> > > 
> > > ```
> > > 
> > > }
> > > 
> > > After running this app javapplication,i am getting the errors like this
> > > 
> > > In Main Method  
> > > Mar 14, 2014 6:05:24 PM org.elasticsearch.node  
> > > INFO: [Mister Machine] {elasticsearch/0.16.1}[11016]: initializing ...
> > > 
> > > Mar 14, 2014 6:05:24 PM org.elasticsearch.plugins  
> > > INFO: [Mister Machine] loaded   
> > > org.elasticsearch.common.inject.internal.ComputationException: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;
> > > 
> > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)  
> > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
> > > 
> > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)  
> > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)
> > > 
> > > at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)  
> > > at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
> > > 
> > > at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)  
> > > at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:169)  
> > > at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:224)
> > > 
> > > at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:120)  
> > > at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:105)
> > > 
> > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:92)  
> > > at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:69)  
> > > at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:58)
> > > 
> > > at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:146)  
> > > at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)  
> > > at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
> > > 
> > > at ES\_Client.main(ES\_Client.java:64)  
> > > Caused by: org.elasticsearch.common.inject.internal.ComputationException: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
> > > 
> > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)  
> > > at org.elasticsearch.common.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
> > > 
> > > at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:46)  
> > > at org.elasticsearch.common.inject.MembersInjectorStore.get(MembersInjectorStore.java:66)  
> > > at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69)
> > > 
> > > at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:31)  
> > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:39)
> > > 
> > > at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35)  
> > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)
> > > 
> > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)  
> > > ... 17 more  
> > > Caused by: java.lang.NoClassDefFoundError: Lorg/apache/lucene/store/Lock;  
> > > at java.lang.Class.getDeclaredFields0(Native Method)
> > > 
> > > at java.lang.Class.privateGetDeclaredFields(Unknown Source)  
> > > at java.lang.Class.getDeclaredFields(Unknown Source)  
> > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:386)
> > > 
> > > at org.elasticsearch.common.inject.spi.InjectionPoint$Factory$1.getMembers(InjectionPoint.java:384)  
> > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:359)
> > > 
> > > at org.elasticsearch.common.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)  
> > > at org.elasticsearch.common.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:295)
> > > 
> > > at org.elasticsearch.common.inject.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:78)  
> > > at org.elasticsearch.common.inject.MembersInjectorStore.access$000(MembersInjectorStore.java:35)
> > > 
> > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:43)  
> > > at org.elasticsearch.common.inject.MembersInjectorStore$1.create(MembersInjectorStore.java:40)
> > > 
> > > at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:35)  
> > > at org.elasticsearch.common.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
> > > 
> > > ... 27 more  
> > > Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Lock  
> > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > at java.net.URLClassLoader$1.run(Unknown Source)  
> > > at java.security.AccessController.doPrivileged(Native Method)
> > > 
> > > at java.net.URLClassLoader.findClass(Unknown Source)  
> > > at java.lang.ClassLoader.loadClass(Unknown Source)  
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > 
> > > ... 41 more
> > > 
> > > from this i came to know that there is problem in Maven Repositry,but i checked the maven,i din't find nay issues.
> > > 
> > > Was i am in the correct path to get the communication from java to elasticsearch.do i need to set any classpath or path related to Elasticsearch.
> > > 
> > > any basic application so that i can look and get some idea.
> > > 
> > > URGENT PLZ
> > > 
> > > Thanks in advance.
> > > 
> > > Regards Venu.Y
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f37c8656-0bf8-4987-a956-2575059fc883%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> How are you running the code? If it is a java app have you specified all  
> the jar in the path?

--  
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/b554e5a6-25af-425b-9c9a-3f6f8b3df5cd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b554e5a6-25af-425b-9c9a-3f6f8b3df5cd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

[Next page](https://discuss.elastic.co/t/elasticsearch-java-interaction/16375.md?page=2)
