# NoClassDefFoundError: Could not initialize class org.elasticsearch.common.network.NetworkService

**URL:** https://discuss.elastic.co/t/noclassdeffounderror-could-not-initialize-class-org-elasticsearch-common-network-networkservice/100020
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [September 11, 2017, 8:25am UTC](https://discuss.elastic.co/t/noclassdeffounderror-could-not-initialize-class-org-elasticsearch-common-network-networkservice/100020 "2017-09-11T08:25:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kirito940613](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@Kirito940613](https://discuss.elastic.co/u/Kirito940613)
#### Post date: [September 11, 2017, 8:25am UTC](https://discuss.elastic.co/t/noclassdeffounderror-could-not-initialize-class-org-elasticsearch-common-network-networkservice/100020/1 "2017-09-11T08:25:06Z")

</div>

public final static TransportClient getClient() {  
synchronized (EsUtil.class) {  
if(client == null)  
try {

```
                Settings settings = Settings.builder()
                        .put("cluster.name", clusterName)
                        .put("client.transport.sniff", true)
                        .build();

                client = new PreBuiltTransportClient(settings)
                                .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("10.6.80.104"), 9320))
                                .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("10.6.80.119"), 9320));
            } catch (UnknownHostException e) {
                e.printStackTrace();
            }
    }
    return client;
}

```

I want to submit spark job from local to remote cluster.When i use spark.master =local[\*],it works well.But i change it to my remote cluster uri,it throws exception like topic,anyone else know how to solve?My es-version is 5.3.0 and i have try 5.2.2 but it doesn't work.

---

<div class="post-metadata">

### Author: ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)
#### Post date: [September 12, 2017, 3:40pm UTC](https://discuss.elastic.co/t/noclassdeffounderror-could-not-initialize-class-org-elasticsearch-common-network-networkservice/100020/2 "2017-09-12T15:40:27Z")

</div>

This does not look ES-Hadoop related, but rather an issue with the Elasticsearch transport client. Have you thought about using ES-Hadoop for your spark workloads instead?

---

<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 10, 2017, 3:40pm UTC](https://discuss.elastic.co/t/noclassdeffounderror-could-not-initialize-class-org-elasticsearch-common-network-networkservice/100020/3 "2017-10-10T15:40:39Z")

</div>

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