# org.elasticsearch.join.ParentJoinPlugin giving error

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274>\
**Category:** Elasticsearch\
**Created:** [September 20, 2018, 10:43am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274 "2018-09-20T10:43:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritwik1994](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ritwik1994](https://discuss.elastic.co/u/ritwik1994)\
**Post date:** [September 20, 2018, 10:43am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/1 "2018-09-20T10:43:47Z")

</div>

Hi,

I am creating the connection of elastic search 6.4.1 with my spring boot application with help of transportclient but there are stack of exception coming :-

Failed to instantiate [org.elasticsearch.client.Client]: Factory method 'client' threw exception; nested exception is java.lang.IllegalArgumentException: NamedWriteable [org.elasticsearch.index.query.QueryBuilder][parent\_id] is already registered for [org.elasticsearch.search.SearchModule$$Lambda$756/688426301], cannot register [org.elasticsearch.join.ParentJoinPlugin$$Lambda$766/1660136848]

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 20, 2018, 11:55am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/2 "2018-09-20T11:55:01Z")

</div>

can you share some code please, how you are instantiating the transport client? That might be a bug...

---

<div class="post-metadata">

**Author:** ![ritwik1994](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ritwik1994](https://discuss.elastic.co/u/ritwik1994)\
**Post date:** [September 20, 2018, 11:56am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/3 "2018-09-20T11:56:10Z")

</div>

does elastic search have to do anything with springboot version?

---

<div class="post-metadata">

**Author:** ![ritwik1994](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ritwik1994](https://discuss.elastic.co/u/ritwik1994)\
**Post date:** [September 20, 2018, 11:57am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/4 "2018-09-20T11:57:40Z")

</div>

I am sharing my snapshot of pom file :-

I am using 2.0.0.M3 version of spring-boot-starter-parent and this is giving error but when I used 2.0.5 version of spring boot it works fine

 org.springframework.boot spring-boot-starter-parent 2.0.0.M3 org.springframework.data spring-data-elasticsearch 3.0.10.RELEASE 

```
	<dependency>
		<groupId>org.elasticsearch.client</groupId>
		<artifactId>transport</artifactId>
		<version>6.4.0</version>
	</dependency>
	
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-api</artifactId>
		<version>2.11.1</version>
	</dependency>
	
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-core</artifactId>
		<version>2.11.1</version>
	</dependency>
	<!-- https://mvnrepository.com/artifact/org.elasticsearch.plugin/parent-join-client -->
	
	
	
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-web</artifactId>
		<version>2.11.1</version>
	</dependency>

```

These are the major dependecies I am using

---

<div class="post-metadata">

**Author:** ![ritwik1994](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ritwik1994](https://discuss.elastic.co/u/ritwik1994)\
**Post date:** [September 20, 2018, 12:01pm UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/5 "2018-09-20T12:01:05Z")

</div>

import java.net.InetAddress;  
import java.net.UnknownHostException;

import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.settings.Settings;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;  
import org.elasticsearch.common.transport.TransportAddress;  
import org.elasticsearch.transport.client.PreBuiltTransportClient;  
import org.springframework.beans.factory.annotation.Value;  
import org.springframework.context.annotation.Bean;  
import org.springframework.context.annotation.ComponentScan;  
import org.springframework.context.annotation.Configuration;  
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;  
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;  
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

@Configuration  
@EnableElasticsearchRepositories(basePackages = "com.dao.elasticSearch")  
@ComponentScan(basePackages = { "com.service.elasticSearch" })  
public class ElasticSearchConfiguration {

```
    @Bean
    public Client client() {
        TransportClient client = null;
        try {

```

// final Settings elasticsearchSettings = Settings.builder()  
// .put("client.transport.sniff", true)InetSocketTransportAddress  
// .put("path.home", elasticsearchHome)  
// .put("cluster.name", clusterName).build();  
client = new PreBuiltTransportClient(Settings.EMPTY);  
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));  
} catch (UnknownHostException e) {  
e.printStackTrace();  
}  
// client = new PreBuiltTransportClient(Settings.EMPTY);  
// client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));

```
        return client;
    }

    @Bean
    public ElasticsearchOperations elasticsearchTemplate() {
        return new ElasticsearchTemplate(client());
    }

```

}

---

<div class="post-metadata">

**Author:** ![ritwik1994](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ritwik1994](https://discuss.elastic.co/u/ritwik1994)\
**Post date:** [September 21, 2018, 6:27am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/6 "2018-09-21T06:27:10Z")

</div>

The issue was with the maven version. Solved by using latest one.

---

<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 19, 2018, 6:27am UTC](https://discuss.elastic.co/t/org-elasticsearch-join-parentjoinplugin-giving-error/149274/7 "2018-10-19T06:27:26Z")

</div>

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