# Exception in thread "main" java.lang.IllegalStateException: Unsupported transport.type \[netty4\]

**URL:** <https://discuss.elastic.co/t/exception-in-thread-main-java-lang-illegalstateexception-unsupported-transport-type-netty4/119996>\
**Category:** Elasticsearch\
**Created:** [February 15, 2018, 1:50pm UTC](https://discuss.elastic.co/t/exception-in-thread-main-java-lang-illegalstateexception-unsupported-transport-type-netty4/119996 "2018-02-15T13:50:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathish\_AH\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sathish\_AH\_Kumar](https://discuss.elastic.co/u/sathish_AH_Kumar)\
**Post date:** [February 15, 2018, 1:50pm UTC](https://discuss.elastic.co/t/exception-in-thread-main-java-lang-illegalstateexception-unsupported-transport-type-netty4/119996/1 "2018-02-15T13:50:53Z")

</div>

Am trying to connect our ES from Java App using TransportClient.

ES Version 6.1.0

POM:

```
<dependency>
	<groupId>org.elasticsearch</groupId>
	<artifactId>elasticsearch</artifactId>
	<version>6.1.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.elasticsearch.client/transport -->
<dependency>
	<groupId>org.elasticsearch.client</groupId>
	<artifactId>transport</artifactId>
	<version>6.2.0</version>
</dependency>

```

Code Snippet:

Settings settings = Settings.builder().put("cluster.name", "elasticsearch")  
.put("client.transport.sniff", true).build();  
TransportClient client = new PreBuiltTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName(ES\_HOST), ES\_PORT));

Getting below Exception:

Error Trace:

Exception in thread "main" java.lang.IllegalStateException: Unsupported transport.type [netty4]  
at org.elasticsearch.common.network.NetworkModule.getTransportSupplier(NetworkModule.java:210)  
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:176)  
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:262)  
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:128)  
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:114)  
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:104)

---

<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:** [February 15, 2018, 4:21pm UTC](https://discuss.elastic.co/t/exception-in-thread-main-java-lang-illegalstateexception-unsupported-transport-type-netty4/119996/2 "2018-02-15T16:21:58Z")

</div>

Why are you adding a dependency on elasticsearch itself? And why another version?

---

<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:** [March 15, 2018, 4:21pm UTC](https://discuss.elastic.co/t/exception-in-thread-main-java-lang-illegalstateexception-unsupported-transport-type-netty4/119996/3 "2018-03-15T16:21:59Z")

</div>

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