# Problem with Spring factories for Elasticsearch: "Incorrect settings. You must set esNodes when creating a transport client"

**URL:** https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989
**Category:** Elasticsearch
**Created:** [March 4, 2013, 10:24am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989 "2013-03-04T10:24:43Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)
#### Post date: [March 4, 2013, 10:24am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/1 "2013-03-04T10:24:43Z")

</div>

Hi all,  
i'm trying to use Spring factories for Elasticsearch in my project, i  
delared the different dependency in my pom.xml, and now i whould like to  
declare the node and the client in my application-context.xml, so i write  
these lines:

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

localhost:9300  
localhost:9301

but when i started the server i have the flowing error, "Incorrect  
settings. You must set esNodes when creating a transport client"

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 4, 2013, 11:00am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/2 "2013-03-04T11:00:18Z")

</div>

Hi Ammar,

Sounds like you are mixing things here.  
If you want to start a node and get a client from that node, just do:  
\<elasticsearch:node id="esNode" /\>  
\<elasticsearch:client node="esNode" id="esClient" /\>  
If you have already a node running outside your spring project and want to use a Transport Client, just do:  
\<elasticsearch:client id="esClient" /\>

In your spring file, you tried to define 3 times the `esClient` bean.

Does it help?

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

Le 4 mars 2013 à 11:24, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> Hi all,  
> i'm trying to use Spring factories for Elasticsearch in my project, i delared the different dependency in my pom.xml, and now i whould like to declare the node and the client in my application-context.xml, so i write these lines:
> 
> \<elasticsearch:client id="esClient" /\>  
> \<elasticsearch:node id="esNode" /\>  
> \<elasticsearch:client node="esNode" id="esClient" /\>
> 
> localhost:9300  
> localhost:9301
> 
> but when i started the server i have the flowing error, "Incorrect settings. You must set esNodes when creating a transport client"
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)
#### Post date: [March 4, 2013, 11:30am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/3 "2013-03-04T11:30:56Z")

</div>

hi david,  
thank you, the former problem is solved, I wrote \<elasticsearch:node  
id="esNode" /\>

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

, and when I want to use my client, I declare just the following commits ?:

@Autowired  
private Client esClient  
.........

esClient.prepareSearch()..........

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 4, 2013, 11:32am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/4 "2013-03-04T11:32:26Z")

</div>

Yes. It should work like this.

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

Le 4 mars 2013 à 12:30, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> hi david,  
> thank you, the former problem is solved, I wrote \<elasticsearch:node id="esNode" /\>  
> \<elasticsearch:client node="esNode" id="esClient" /\>
> 
> , and when I want to use my client, I declare just the following commits ?:
> 
> @Autowired  
> private Client esClient  
> .........
> 
> esClient.prepareSearch()..........
> 
> 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)
#### Post date: [March 4, 2013, 1:40pm UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/5 "2013-03-04T13:40:49Z")

</div>

i have my class declared us follwing:

public class QueryElasticSearch {

@Autowired  
private Client esClient;

public ResponseQuery buildQuery(Query queryS) {  
ResponseQuery responseQuery = new ResponseQuery();  
responseQuery.setQuery(queryS);  
QueryBuilder query = QueryBuilders.queryString(queryS.getKeyword());  
SearchResponse searchHits =  
esClient.prepareSearch().setIndices("mydocs")...........}

but esClient value is null, is that I must declare otherwise ?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 4, 2013, 2:01pm UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/6 "2013-03-04T14:01:20Z")

</div>

Do you have setter for esClient field?  
Did you annotate your class with @Component?  
Did you scan your package for annotations?

Something like: [https://github.com/dadoonet/spring-elasticsearch/blob/master/src/test/resources/annotation-context.xml](https://github.com/dadoonet/spring-elasticsearch/blob/master/src/test/resources/annotation-context.xml)

\<context:annotation-config /\>  
\<context:component-scan base-package="fr.pilato.spring.elasticsearch.annotation" /\>

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

Le 4 mars 2013 à 14:40, Ammar Yahia [yahia.ammar.info@gmail.com](mailto:yahia.ammar.info@gmail.com) a écrit :

> i have my class declared us follwing:
> 
> public class QueryElasticSearch {
> 
> @Autowired  
> private Client esClient;
> 
> public ResponseQuery buildQuery(Query queryS) {  
> ResponseQuery responseQuery = new ResponseQuery();  
> responseQuery.setQuery(queryS);  
> QueryBuilder query = QueryBuilders.queryString(queryS.getKeyword());  
> SearchResponse searchHits = esClient.prepareSearch().setIndices("mydocs")...........}
> 
> but esClient value is null, is that I must declare otherwise ?
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![yahia](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yahia](https://discuss.elastic.co/u/yahia)
#### Post date: [March 4, 2013, 2:44pm UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/7 "2013-03-04T14:44:21Z")

</div>

it works, I have not been paying attention when calling my class  
QueryElasticSearch that  
contains the field client, I made a simple instantiation of my class  
instead of going through spring for my class instantiation,

Thanks a lot David,

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Srikanth\_gone](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Srikanth\_gone](https://discuss.elastic.co/u/Srikanth_gone)
#### Post date: [March 6, 2013, 7:03am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/8 "2013-03-06T07:03:29Z")

</div>

Hi All,  
ihave facing problem with this exception

org.springframework.beans.factory.BeanCreationException: Error creating  
bean with name 'esNode' defined in class path resource  
[com/newwave/dc/elasticsearch/annotation/AppConfig.class]: No matching  
factory method found: factory bean 'appConfig'; factory method 'esNode()'.  
Check that a method with the specified name exists and that it is  
non-static.

can anyone help me.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2013, 9:14am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/9 "2013-03-06T09:14:14Z")

</div>

Hi,

Sounds like you want to only use annotations and not the xml spring files, don't you?  
If so, you have to define a method named esNode() in your AppConfig class.

Have a look here: [https://github.com/scrutmydocs/scrutmydocs/blob/master/src/main/java/org/scrutmydocs/webapp/configuration/AppConfig.java#L56](https://github.com/scrutmydocs/scrutmydocs/blob/master/src/main/java/org/scrutmydocs/webapp/configuration/AppConfig.java#L56)

Does it help?

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

Le 6 mars 2013 à 08:03, srikanth gone [srikanthg93@gmail.com](mailto:srikanthg93@gmail.com) a écrit :

> Hi All,  
> ihave facing problem with this exception
> 
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'esNode' defined in class path resource [com/newwave/dc/elasticsearch/annotation/AppConfig.class]: No matching factory method found: factory bean 'appConfig'; factory method 'esNode()'. Check that a method with the specified name exists and that it is non-static.
> 
> can anyone help me.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![smhdiu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smhdiu/32/1808_2.png) [@smhdiu](https://discuss.elastic.co/u/smhdiu)
#### Post date: [March 6, 2013, 11:48am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/10 "2013-03-06T11:48:24Z")

</div>

you can have a look at Spring data elasticsearch ! [https://github.com/BioMedCentralLtd/spring-data-elasticsearch](https://github.com/BioMedCentralLtd/spring-data-elasticsearch)

On Monday, 4 March 2013 10:24:43 UTC, Ammar Yahia wrote:

> Hi all,  
> i'm trying to use Spring factories for Elasticsearch in my project, i  
> delared the different dependency in my pom.xml, and now i whould like to  
> declare the node and the client in my application-context.xml, so i write  
> these lines:
> 
> \<elasticsearch:client id="esClient" /\>  
> \<elasticsearch:node id="esNode" /\>  
> \<elasticsearch:client node="esNode" id="esClient" /\>
> 
> \<bean id="esClient"
> 
> class="fr.pilato.spring.elasticsearch.ElasticsearchTransportClientFactoryBean"\>  
>   
>   
> localhost:9300  
> localhost:9301
> 
> but when i started the server i have the flowing error, "Incorrect  
> settings. You must set esNodes when creating a transport client"

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Srikanth\_gone](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Srikanth\_gone](https://discuss.elastic.co/u/Srikanth_gone)
#### Post date: [March 6, 2013, 12:47pm UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/11 "2013-03-06T12:47:13Z")

</div>

Hi David,

I have used these two tags in applicationcontext.xml

\<elasticsearch:client id="esClient" /\>

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

i am getting this log..

18:08:50,265 DEBUG [ElasticsearchNodeFactoryBean] Starting ElasticSearch node...  
18:08:52,843 INFO [ElasticsearchNodeFactoryBean] Node [junit.node] for [junit.cluster] cluster started...  
18:08:52,843 DEBUG [ElasticsearchNodeFactoryBean] - data : /es/twitter  
18:08:52,843 DEBUG [ElasticsearchNodeFactoryBean] - logs : D:/ProgramFiles/Apache Software Foundation/Tomcat 5.5/logs  
18:08:52,875 INFO [ElasticsearchClientFactoryBean] Starting ElasticSearch client  
18:08:52,875 DEBUG [ElasticsearchClientFactoryBean] Automatic discovery is activated. Looking for definition files in classpath under /es.  
18:08:52,875 DEBUG [ElasticsearchClientFactoryBean] Automatic discovery found twitter/tweet json file in classpath under /es.  
18:08:52,890 TRACE [ElasticsearchClientFactoryBean] createIndex(twitter)  
18:08:52,890 DEBUG [ElasticsearchClientFactoryBean] Index twitter doesn't exist. Creating it.  
18:08:52,890 TRACE [ElasticsearchClientFactoryBean] Found settings for index twitter : { "index" : { "number\_of\_shards" : 3, "number\_of\_replicas" : 2 }}  
18:08:53,593 TRACE [ElasticsearchClientFactoryBean] /createIndex(twitter)  
18:08:53,593 TRACE [ElasticsearchClientFactoryBean] pushMapping(twitter,tweet,false)  
18:08:53,593 DEBUG [ElasticsearchClientFactoryBean] Mapping [twitter]/[tweet] doesn't exist. Creating it.  
18:08:53,593 TRACE [ElasticsearchClientFactoryBean] Mapping for [twitter]/[tweet]={ "tweet" : { "properties" : { "message" : {"type" : "string", "store" : "yes"} } }}  
18:08:53,953 DEBUG [ElasticsearchClientFactoryBean] Mapping definition for [twitter]/[tweet] succesfully created.  
18:08:53,953 TRACE [ElasticsearchClientFactoryBean] /pushMapping(twitter,tweet,false)  
18:08:56,937 ERROR [DispatcherServlet] Context initialization failed  
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'esNode' defined in class path resource [com/newwave/dc/elasticsearch/annotation/AppConfig.class]: No matching factory method found: factory bean 'appConfig'; factory method 'esNode()'. Check that a method with the specified name exists and that it is non-static.

this is AppConfig Class

@Configuration  
public class AppConfig {

```
@Bean
public Node esNode() throws Exception {
	ElasticsearchNodeFactoryBean factory = new ElasticsearchNodeFactoryBean();
	factory.afterPropertiesSet();
	return factory.getObject();
}

@Bean
public Client esClient() throws Exception {
	ElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();
	factory.setNode(esNode());
	factory.afterPropertiesSet();
	return factory.getObject();
	}

```

}

is there any mixing things?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2013, 1:51pm UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/12 "2013-03-06T13:51:23Z")

</div>

Don't add the both ways of creating Node and Client.  
Use AppConfig or beans in applicationContext.xml.

I would say, remove you AppConfig class (or at least remove @Configuration annotation for your test).

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

Le 6 mars 2013 à 13:47, srikanth gone [srikanthg93@gmail.com](mailto:srikanthg93@gmail.com) a écrit :

> Hi David,
> 
> I have used these two tags in applicationcontext.xml
> 
> \<elasticsearch:client id="esClient" /\>
> 
> \<elasticsearch:client node="esNode" id="esClient" /\>
> 
> i am getting this log..
> 
> 18:08:50,265 DEBUG [ElasticsearchNodeFactoryBean] Starting Elasticsearch node...  
> 18:08:52,843 INFO [ElasticsearchNodeFactoryBean] Node [junit.node] for [junit.cluster] cluster started...  
> 18:08:52,843 DEBUG [ElasticsearchNodeFactoryBean] - data : /es/twitter  
> 18:08:52,843 DEBUG [ElasticsearchNodeFactoryBean] - logs : D:/ProgramFiles/Apache Software Foundation/Tomcat 5.5/logs  
> 18:08:52,875 INFO [ElasticsearchClientFactoryBean] Starting Elasticsearch client  
> 18:08:52,875 DEBUG [ElasticsearchClientFactoryBean] Automatic discovery is activated. Looking for definition files in classpath under /es.  
> 18:08:52,875 DEBUG [ElasticsearchClientFactoryBean] Automatic discovery found twitter/tweet json file in classpath under /es.  
> 18:08:52,890 TRACE [ElasticsearchClientFactoryBean] createIndex(twitter)  
> 18:08:52,890 DEBUG [ElasticsearchClientFactoryBean] Index twitter doesn't exist. Creating it.  
> 18:08:52,890 TRACE [ElasticsearchClientFactoryBean] Found settings for index twitter : { "index" : { "number\_of\_shards" : 3, "number\_of\_replicas" : 2 }}  
> 18:08:53,593 TRACE [ElasticsearchClientFactoryBean] /createIndex(twitter)  
> 18:08:53,593 TRACE [ElasticsearchClientFactoryBean] pushMapping(twitter,tweet,false)  
> 18:08:53,593 DEBUG [ElasticsearchClientFactoryBean] Mapping [twitter]/[tweet] doesn't exist. Creating it.  
> 18:08:53,593 TRACE [ElasticsearchClientFactoryBean] Mapping for [twitter]/[tweet]={ "tweet" : { "properties" : { "message" : {"type" : "string", "store" : "yes"} } }}  
> 18:08:53,953 DEBUG [ElasticsearchClientFactoryBean] Mapping definition for [twitter]/[tweet] succesfully created.  
> 18:08:53,953 TRACE [ElasticsearchClientFactoryBean] /pushMapping(twitter,tweet,false)  
> 18:08:56,937 ERROR [DispatcherServlet] Context initialization failed  
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'esNode' defined in class path resource [com/newwave/dc/elasticsearch/annotation/AppConfig.class]: No matching factory method found: factory bean 'appConfig'; factory method 'esNode()'. Check that a method with the specified name exists and that it is non-static.
> 
> this is AppConfig Class
> 
> @Configuration  
> public class AppConfig {
> 
> @Bean  
> public Node esNode() throws Exception {  
> ElasticsearchNodeFactoryBean factory = new ElasticsearchNodeFactoryBean();  
> factory.afterPropertiesSet();  
> return factory.getObject();  
> }
> 
> @Bean  
> public Client esClient() throws Exception {  
> ElasticsearchClientFactoryBean factory = new ElasticsearchClientFactoryBean();  
> factory.setNode(esNode());  
> factory.afterPropertiesSet();  
> return factory.getObject();  
> }
> 
> }
> 
> is there any mixing things?
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Srikanth\_gone](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Srikanth\_gone](https://discuss.elastic.co/u/Srikanth_gone)
#### Post date: [March 6, 2013, 5:17pm UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/13 "2013-03-06T17:17:21Z")

</div>

Hi David,

thank you, issue resolved.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:48am UTC](https://discuss.elastic.co/t/problem-with-spring-factories-for-elasticsearch-incorrect-settings-you-must-set-esnodes-when-creating-a-transport-client/10989/14 "2017-07-06T02:48:02Z")

</div>


