# \[2.2.0\] \[Java\] Embedded Server + Groovy scripts

**URL:** <https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845>\
**Category:** Elasticsearch\
**Created:** [March 31, 2017, 4:38pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845 "2017-03-31T16:38:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patryk](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Patryk](https://discuss.elastic.co/u/Patryk)\
**Post date:** [March 31, 2017, 4:38pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845/1 "2017-03-31T16:38:52Z")

</div>

Hi,  
For testing purposes, I need to run a groovy script in an update request against the embedded server. My problem is that I am not able to load a Groove Script Engine. I added this maven dependency:

```
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>2.4.0</version>

```

But I am still getting this error when I try to make a call:

"Caused by: java.lang.IllegalArgumentException: script\_lang not supported [groovy]  
at org.elasticsearch.script.ScriptService.getScriptEngineServiceForLang(ScriptService.java:211)  
at org.elasticsearch.script.ScriptService.compile(ScriptService.java:241)  
at org.elasticsearch.script.ScriptService.executable(ScriptService.java:441)  
at org.elasticsearch.action.update.UpdateHelper.executeScript(UpdateHelper.java:249)"

Is there any way to run a groovy script in Embedded ES 2.2.0 using Java Client?

My node configuration is like that:

```
    nodeBuilder
            .clusterName("testing")
            .local(true)
    ;
    nodeBuilder.settings()
            .put("client.transport.ping_timeout", "5s")
            .put("path.home", "test")
            .put("number_of_shards", 1)
            .put("http.enabled", false)
    ;
```

---

<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 31, 2017, 5:29pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845/2 "2017-03-31T17:29:09Z")

</div>

Embedding elasticsearch is [not supported anymore](https://www.elastic.co/blog/elasticsearch-the-server).

---

<div class="post-metadata">

**Author:** ![Patryk](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Patryk](https://discuss.elastic.co/u/Patryk)\
**Post date:** [March 31, 2017, 5:31pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845/3 "2017-03-31T17:31:22Z")

</div>

So, there is not a solution for my problem even if I use 2.2.0? What is the current proposition for integration testing - run a stand-alone server?

---

<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 31, 2017, 5:49pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845/4 "2017-03-31T17:49:37Z")

</div>

There are plenty of threads about integration testing on this forum.

In short: run your tests against an external server.

If you are using maven, the maven elasticsearch plugin is really nice.  
You can also read [http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/](http://david.pilato.fr/blog/2016/10/18/elasticsearch-real-integration-tests-updated-for-ga/)

---

<div class="post-metadata">

**Author:** ![Patryk](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Patryk](https://discuss.elastic.co/u/Patryk)\
**Post date:** [March 31, 2017, 5:51pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845/5 "2017-03-31T17:51:47Z")

</div>

Thanks.

---

<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:** [April 28, 2017, 5:52pm UTC](https://discuss.elastic.co/t/2-2-0-java-embedded-server-groovy-scripts/80845/6 "2017-04-28T17:52:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
