# Java transport client do not work after upgrade to 6.5.3

**URL:** <https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726>\
**Category:** Elasticsearch\
**Created:** [December 20, 2018, 4:04pm UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726 "2018-12-20T16:04:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanqwam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivanqwam/32/28102_2.png) [@ivanqwam](https://discuss.elastic.co/u/ivanqwam)\
**Post date:** [December 20, 2018, 4:04pm UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726/1 "2018-12-20T16:04:36Z")

</div>

We have a Java transport client which worked fine with 6.2 jars on a 6.2 cluster but cannot connect anymore after 6.5.3 upgrade of both client and server.

We did the following

1. upgrade jars to 6.5.3
2. recompiled our client
3. upgraded one node of our cluster in 6.5.3
4. Run our 6.5.3 client against this 6.5.3 node

We get this:

```
2018/12/20 16:20:49 678-qes5.1.0-null-TRACE-QESHost_elastic21-sessionClient()	: Nouvelle connexion ...:localhost:9300|
2018/12/20 16:20:49 678-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: cluster:elasticsearch|
2018/12/20 16:20:49 678-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: host:localhost|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: port:9300|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: Connection avec Xpack|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: Login:elastic|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: Path certificat:/usr/software/conf/elastic-certificates.p12|
2018/12/20 16:20:49 680-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: Path authorities:/usr/software/conf/elastic-certificates.p12|
2018/12/20 16:20:49 680-qes5.1.0-null-DEBUG-QESHost_elastic21-connect()	: Avec certificats|
2018/12/20 16:20:50 411-qes5.1.0-null-ERROR-QESHost_elastic21-connect()	: Erreur de connexion:NamedWriteable [org.elasticsearch.cluster.NamedDiff][persistent_tasks] is already registered for [org.elasticsearch.cluster.ClusterModule$$Lambda$777/506775047], cannot register [org.elasticsearch.xpack.core.XPackClientPlugin$$Lambda$784/402207819]|
java.lang.IllegalArgumentException: NamedWriteable [org.elasticsearch.cluster.NamedDiff][persistent_tasks] is already registered for [org.elasticsearch.cluster.ClusterModule$$Lambda$777/506775047], cannot register [org.elasticsearch.xpack.core.XPackClientPlugin$$Lambda$784/402207819]
	at org.elasticsearch.common.io.stream.NamedWriteableRegistry.<init>(NamedWriteableRegistry.java:91)
	at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:163)
	at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:284)
	at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
	at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:59)
	at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:54)
	at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:50)
	at com.qwam.qeshost.QESHost_elastic21.connect(QESHost_elastic21.java:157)
	at com.qwam.qeshost.QESHost_elastic21.sessionClient(QESHost_elastic21.java:268)
	at com.qwam.qeshost.QESHost_elastic21.setBase(QESHost_elastic21.java:340)
	at com.qwam.qesutil.qeselasticindex.connectelastic(qeselasticindex.java:194)
	at com.qwam.qesutil.qeselasticindex.main(qeselasticindex.java:1015)
2018/12/20 16:20:50 411-qes5.1.0-null-ERROR-QESHost_elastic21-sessionClient()	: Connexion impossible:null|

```

Here is our code:

```
            ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Login", login);
            ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Path certificat", pathCertificate);
            ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Path authorities", pathAuthorities);

            // Connection avec Xpack installe: driver=login|password|path_certificat
            Settings settings = null;

                ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Avec certificats");
                settings = Settings.builder()
                    .put("cluster.name", cluster)
                    .put("xpack.security.user", login + ":" + password)
                    .put("xpack.ssl.keystore.path", pathCertificate)
                    .put("xpack.ssl.truststore.path", pathAuthorities)
                    .put("xpack.security.transport.ssl.enabled", "true")
                    .put("xpack.security.transport.ssl.verification_mode", "certificate")
                    .build();

            client = new PreBuiltXPackTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName(host), port));

```

Our old 6.2 Java Transport client is still working on this 6.5.3 node. This looks to have something to do with the new jars and the recompilation

Tried to regenerate a new certificate with ...

/usr/software/elasticsearch/bin/elasticsearch-certutil ca

... and use it instead, without success.

I missing something there.......

---

<div class="post-metadata">

**Author:** ![ivanqwam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivanqwam/32/28102_2.png) [@ivanqwam](https://discuss.elastic.co/u/ivanqwam)\
**Post date:** [December 21, 2018, 10:24am UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726/2 "2018-12-21T10:24:23Z")

</div>

Upgrading **all** nodes to 6.5.3 did not help, no connection and the message is still there

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 23, 2018, 9:50am UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726/3 "2018-12-23T09:50:11Z")

</div>

> [@ivanqwam](#):
>
> java.lang.IllegalArgumentException: NamedWriteable [org.elasticsearch.cluster.NamedDiff][persistent\_tasks] is already registered for [org.elasticsearch.cluster.ClusterModule$$Lambda$777/506775047], cannot register [org.elasticsearch.xpack.core.XPackClientPlugin$$Lambda$784/402207819]

I think you have a stale dependency somewhere within your client. In 6.3+, `XPackClientPlugin` does not try and register a `persistent_tasks` named writeable, but it did in 6.2.

---

<div class="post-metadata">

**Author:** ![ivanqwam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivanqwam/32/28102_2.png) [@ivanqwam](https://discuss.elastic.co/u/ivanqwam)\
**Post date:** [December 27, 2018, 9:18am UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726/4 "2018-12-27T09:18:58Z")

</div>

Hi David,

I had a couple of old x-pack-6.2-XXX.jar in my CLASSPATH and I missed it (the list is becoming very long those days). Sorry for that.

I missed this maven dependency in the upgrade from 6.2 to 6.5

```
      <dependency>
     <groupId>org.elasticsearch.client</groupId>
     <artifactId>x-pack-transport</artifactId>
          <version>6.5.3</version>
  </dependency>

```

It is clearly explained here

[https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack-client.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack-client.html)

I am afraid it is a RTFM from my side. I apologize for that.  
Please close this case.

Thank you David for your help.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 27, 2018, 9:53am UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726/5 "2018-12-27T09:53:01Z")

</div>

> [@ivanqwam](#):
>
> I am afraid it is a RTFM from my side. I apologize for that.

Not at all. You probably aren't the only person ever to do this, and now that your question is here it will help others in the same situation. Thanks for confirming the fix.

---

<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:** [January 24, 2019, 9:53am UTC](https://discuss.elastic.co/t/java-transport-client-do-not-work-after-upgrade-to-6-5-3/161726/6 "2019-01-24T09:53:03Z")

</div>

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