Proble with Spring-Elasticsearch: transportClient

hi all,

I want to use in my application a transport client whith
spring-elasticsearch, so in my applicationcontext file I wrote,

<elasticsearch:client id="esClient" />

but when i start up the server i have the following error:

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from file
[C:\Users\hp\workspacePFE.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nLooker\WEB-INF\classes\META-INF\spring\applicationContext.xml];
nested exception is java.lang.RuntimeException: Incorrect settings. You
must set esNodes when creating a transport client.
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
...........
Caused by: java.lang.RuntimeException: Incorrect settings. You must set
esNodes when creating a transport client.
at
fr.pilato.spring.elasticsearch.xml.ClientBeanDefinitionParser.parse(ClientBeanDefinitionParser.java:38)
at
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
............

if I go through another configuration creation of a node and a client node
from that node, there is no problem:

<elasticsearch:node id="esNode" />
<elasticsearch:client node="esNode" id="esClient" />

But in my application I only want to create tranportClient !!!

how I can proceed

cordially

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I would say: read the doc :wink:
But you're right, it's not well explained.

You can use like this: https://github.com/dadoonet/spring-elasticsearch#transport-client-network-settings

Or something like that:

<elasticsearch:client id="testTransportClient" esNodes="localhost:9300"
settingsFile="fr/pilato/spring/elasticsearch/xml/esclient-transport.properties" />

See: https://github.com/dadoonet/spring-elasticsearch/blob/master/src/test/resources/fr/pilato/spring/elasticsearch/xml/es-transport-client-namespace-test-context.xml

If you need to add more nodes using this esNodes property… Shame on me. I'm afraid you can't. Open an issue?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 3 avr. 2013 à 15:21, Ammar Yahia yahia.ammar.info@gmail.com a écrit :

hi all,

I want to use in my application a transport client whith spring-elasticsearch, so in my applicationcontext file I wrote,

<elasticsearch:client id="esClient" />

but when i start up the server i have the following error:

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [C:\Users\hp\workspacePFE.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nLooker\WEB-INF\classes\META-INF\spring\applicationContext.xml]; nested exception is java.lang.RuntimeException: Incorrect settings. You must set esNodes when creating a transport client.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
...........
Caused by: java.lang.RuntimeException: Incorrect settings. You must set esNodes when creating a transport client.
at fr.pilato.spring.elasticsearch.xml.ClientBeanDefinitionParser.parse(ClientBeanDefinitionParser.java:38)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
............

if I go through another configuration creation of a node and a client node from that node, there is no problem:

<elasticsearch:node id="esNode" />
<elasticsearch:client node="esNode" id="esClient" />

But in my application I only want to create tranportClient !!!

how I can proceed

cordially

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

ie if I have another node running on another machine, the trasport client
can not connect to this node?
transport client can not connect to different nodes simutaneously ??

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

something like this <elasticsearch:client id="testTransportClient"
esNodes="localhost:9300"
esNodes="host2:9200" esNodes="host3:9200"

	settingsFile="fr/pilato/spring/elasticsearch/xml/esclient-transport.properties"

/>
??

2013/4/3 Ammar Yahia yahia.ammar.info@gmail.com

ie if I have another node running on another machine, the trasport client
can not connect to this node?
transport client can not connect to different nodes simutaneously ??

--
Yahia AMMAR

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

You have to use:




localhost:9300
host2:9300



It does not work by using elasticsearch:client form.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 3 avr. 2013 à 16:50, Ammar Yahia yahia.ammar.info@gmail.com a écrit :

something like this <elasticsearch:client id="testTransportClient" esNodes="localhost:9300" esNodes="host2:9200" esNodes="host3:9200"
settingsFile="fr/pilato/spring/elasticsearch/xml/esclient-transport.properties" />

??

2013/4/3 Ammar Yahia yahia.ammar.info@gmail.com
ie if I have another node running on another machine, the trasport client can not connect to this node?
transport client can not connect to different nodes simutaneously ??

--
Yahia AMMAR

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

is that there is a difference between <elasticsearch:client and <bean
id="esClient"
??

2013/4/3 David Pilato david@pilato.fr

You have to use:




localhost:9300
host2:9300

It does not work by using elasticsearch:client form.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 3 avr. 2013 à 16:50, Ammar Yahia yahia.ammar.info@gmail.com a écrit :

something like this <elasticsearch:client id="testTransportClient"
esNodes="localhost:9300" esNodes="host2:9200" esNodes="host3:9200"

  settingsFile="fr/pilato/spring/elasticsearch/xml/esclient-transport.properties" />

??

2013/4/3 Ammar Yahia yahia.ammar.info@gmail.com

ie if I have another node running on another machine, the trasport client
can not connect to this node?
transport client can not connect to different nodes simutaneously ??

--
Yahia AMMAR

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/1iZ9xNaHD7s/unsubscribe?hl=en-US
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Yahia AMMAR

--
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.
For more options, visit https://groups.google.com/groups/opt_out.