# Spring data elasticsearch node-client can't be deployed in Wildfly

**URL:** <https://discuss.elastic.co/t/spring-data-elasticsearch-node-client-cant-be-deployed-in-wildfly/101434>\
**Category:** Elasticsearch\
**Created:** [September 22, 2017, 7:24am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-node-client-cant-be-deployed-in-wildfly/101434 "2017-09-22T07:24:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluething](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bluething/32/22265_2.png) [@bluething](https://discuss.elastic.co/u/bluething)\
**Post date:** [September 22, 2017, 7:24am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-node-client-cant-be-deployed-in-wildfly/101434/1 "2017-09-22T07:24:09Z")

</div>

Hi All,

I have problem when deploying my elasticsearch application into application server.  
I'm using:  
-spring-data-jest [2.3.1.RELEASE]  
-Wildfly 9 as application server  
-Amazon Elasticsearch Service [using Elasticsearch versions 2.3]  
Here's the exception [https://gist.github.com/bluething/bed0b932059f812fe59f9bf2b27a1500](https://gist.github.com/bluething/bed0b932059f812fe59f9bf2b27a1500)  
That exception occur when I deploy to Wildfly. After I googling probably because file under path-home directory still being use by the service, because my Wildfly using hot deployment probably the file still locked.  
Here's my elasticsearch xml config [https://gist.github.com/bluething/3cdee2544fbea6939b4effb068a446e6](https://gist.github.com/bluething/3cdee2544fbea6939b4effb068a446e6)

My question:

1. Is it safe to delete path-home dir for node-client config?  
I want to delete that folder (and sub folder) before deployment.

2. If deleting path-home dir is not a good idea, what should I do to solve this problem? I can't change deployment process because need more resource to do it.

3. I don't use any local node, just want to connect to external node (aws service). Why I must set path-home value? Is there any way to delete it from xml config?

---

<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:** [September 22, 2017, 7:50am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-node-client-cant-be-deployed-in-wildfly/101434/2 "2017-09-22T07:50:19Z")

</div>

Embedding an elasticsearch node is not supported.

```auto
Caused by: java.nio.channels.OverlappingFileLockException: null
        at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) ~[na:1.8.0_60]
        at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152) ~[na:1.8.0_60]
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1107) ~[na:1.8.0_60]
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155) ~[na:1.8.0_60]
        at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:114) ~[lucene-core-5.5.2.jar:5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:38:23]
        at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-5.5.2.jar:5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:38:23]
        at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-5.5.2.jar:5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:38:23]
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:174) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.Node.<init>(Node.java:165) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.Node.<init>(Node.java:140) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:150) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.springframework.data.elasticsearch.client.NodeClientFactoryBean.afterPropertiesSet(NodeClientFactoryBean.java:77) ~[spring-data-elasticsearch-2.1.6.RELEASE.jar:na]

```

A TransportClient should be used instead as explained at [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client-connected-to-client-node.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client-connected-to-client-node.html)  
Or a REST Client connected directly to the Client Node as well.

The Client Node is not an embedded Node Client.

I'm not sure what you need to do here but I believe this is the cause of your problem.

---

<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:** [October 20, 2017, 7:50am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-node-client-cant-be-deployed-in-wildfly/101434/3 "2017-10-20T07:50:23Z")

</div>

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