# Upgrade java source code using elasticsearch 1.7 to elasticsearch 2.1

**URL:** <https://discuss.elastic.co/t/upgrade-java-source-code-using-elasticsearch-1-7-to-elasticsearch-2-1/39452>\
**Category:** Elasticsearch\
**Created:** [January 18, 2016, 1:21pm UTC](https://discuss.elastic.co/t/upgrade-java-source-code-using-elasticsearch-1-7-to-elasticsearch-2-1/39452 "2016-01-18T13:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karim\_KOLLI](https://avatars.discourse-cdn.com/v4/letter/k/3d9bf3/32.png) [@Karim\_KOLLI](https://discuss.elastic.co/u/Karim_KOLLI)\
**Post date:** [January 18, 2016, 1:21pm UTC](https://discuss.elastic.co/t/upgrade-java-source-code-using-elasticsearch-1-7-to-elasticsearch-2-1/39452/1 "2016-01-18T13:21:51Z")

</div>

Hello,

I have a java class in order to connect to elasticsearch 1.7 and to make request, we have upgraded elasticsearch to version 2.1 and I have now many errors during runtime :

```
private Client getESClientByTransportClient() {
		
		Client result=null;
		
		Settings settings = Settings.settingsBuilder()
		        .put("cluster.name", "tlssbcloud91").put("network.host","tlssbcloud91.xxxxx.fr").build();
		result = TransportClient.builder().settings(settings).build();
		///result = transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("tlssbcloud91.xxxx.fr"), 9300));
		
		return result;
		
	}

SearchResponse responseYes=client.prepareSearch("milestones").setTypes("pact")
            .setSearchType(SearchType.QUERY_AND_FETCH)
            .setQuery(queryBuilder)
            .setFrom(0).setSize(00).setExplain(true)
            .execute()
            .actionGet();

```

I have this error when executing the request above :

```
java.lang.ClassNotFoundException: com.fasterxml.jackson.core.FormatFeature

```

Can you help me ?

regards

---

<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:** [January 18, 2016, 1:46pm UTC](https://discuss.elastic.co/t/upgrade-java-source-code-using-elasticsearch-1-7-to-elasticsearch-2-1/39452/2 "2016-01-18T13:46:24Z")

</div>

Hi Karim,

You have to import all needed libs now.  
If you are using maven, that's done out of the box but if you are importing elasticsearch to your project manually, you have to add all 3rd party libs yourself.

---

<div class="post-metadata">

**Author:** ![Karim\_KOLLI](https://avatars.discourse-cdn.com/v4/letter/k/3d9bf3/32.png) [@Karim\_KOLLI](https://discuss.elastic.co/u/Karim_KOLLI)\
**Post date:** [January 19, 2016, 10:17am UTC](https://discuss.elastic.co/t/upgrade-java-source-code-using-elasticsearch-1-7-to-elasticsearch-2-1/39452/3 "2016-01-19T10:17:32Z")

</div>

Hi David,

Thank you so much for your advice.  
It's OK now, in fact I have a conflict of version into maven artifacts.

Regards

Karim

---

<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, 11:23pm UTC](https://discuss.elastic.co/t/upgrade-java-source-code-using-elasticsearch-1-7-to-elasticsearch-2-1/39452/4 "2017-07-05T23:23:30Z")

</div>


