# Groovy Client - Closure Issue

**URL:** <https://discuss.elastic.co/t/groovy-client-closure-issue/49333>\
**Category:** Elasticsearch\
**Created:** [May 5, 2016, 7:14pm UTC](https://discuss.elastic.co/t/groovy-client-closure-issue/49333 "2016-05-05T19:14:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saielastic](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@saielastic](https://discuss.elastic.co/u/saielastic)\
**Post date:** [May 5, 2016, 7:14pm UTC](https://discuss.elastic.co/t/groovy-client-closure-issue/49333/1 "2016-05-05T19:14:05Z")

</div>

Hi all,

I am trying to use Groovy Client through Grails application, and getting the error below, any help would be appreciated. if using without closure it works (the Java client way).

Grails version - 2.3.11  
ES version - 1.4  
Groovy Client version - 1.4.4

Code snippet -  
import org.elasticsearch.client.transport.TransportClient  
import org.elasticsearch.common.transport.InetSocketTransportAddress  
import org.elasticsearch.common.settings.ImmutableSettings  
import org.elasticsearch.action.search.SearchResponse  
TransportClient client = new TransportClient(ImmutableSettings.settingsBuilder { cluster { name = "elasticsearch" } client { transport { sniff = true } } });

Error -  
_No signature of method: static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder() is applicable for argument types_

---

<div class="post-metadata">

**Author:** ![saielastic](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@saielastic](https://discuss.elastic.co/u/saielastic)\
**Post date:** [May 6, 2016, 3:57pm UTC](https://discuss.elastic.co/t/groovy-client-closure-issue/49333/2 "2016-05-06T15:57:50Z")

</div>

Any help would be greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 6, 2016, 5:51pm UTC](https://discuss.elastic.co/t/groovy-client-closure-issue/49333/3 "2016-05-06T17:51:58Z")

</div>

Elasticsearch 1.4 is outdated and has severe CVS issues. Do not use it.

Please update to Elasticsearch 2.3+, Groovy 2.4.4+, and Groovy client 2.x, then you can use

```auto
TransportClient client = TransportClient.builder().settings(Settings.settingsBuilder {
  cluster.name = "elasticsearch"
  client.transport.sniff = true
}).build()

```

---

<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 5, 2017, 10:53pm UTC](https://discuss.elastic.co/t/groovy-client-closure-issue/49333/4 "2017-07-05T22:53:17Z")

</div>


