# X-Pack Transport JAR dependency down load issue

**URL:** <https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179>\
**Category:** Elasticsearch\
**Created:** [July 6, 2017, 11:23pm UTC](https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179 "2017-07-06T23:23:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gs21](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gs21](https://discuss.elastic.co/u/gs21)\
**Post date:** [July 6, 2017, 11:23pm UTC](https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179/1 "2017-07-06T23:23:20Z")

</div>

Hello Elastic Team,

To enable the security in the elastic, I downloaded the x-pack plugin. Since then the following code is NOT returning the connection.  
client = new PreBuiltTransportClient(settings).addTransportAddress(  
new InetSocketTransportAddress(inetAddress, port));

Updated the code to  
client = new PreBuiltXPackTransportClient(  
Settings.builder().put("[cluster.name](http://cluster.name)", "elasticsearch").build()).addTransportAddress(  
new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));

Facing run time issue with the latest code  
Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/xpack/XPackPlugin  
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:55)  
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50)  
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46)  
at com.symitar.padapter.ESHelper.getClient(ESHelper.java:142)  
at com.symitar.padapter.ESHelper.main(ESHelper.java:67)  
**Caused by: java.lang.ClassNotFoundException: org.elasticsearch.xpack.XPackPlugin**  
at java.net.URLClassLoader.findClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
at java.lang.ClassLoader.loadClass(Unknown Source)  
... 5 more

**Tried to down load the dependency as per the link "[https://www.elastic.co/guide/en/x-pack/current/api-java.html](https://www.elastic.co/guide/en/x-pack/current/api-java.html)"**

**[ERROR] Failed to execute goal on project my-app: Could not resolve dependencies for project com.mycompany.app:my-app:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.elasticsearch.client:x-pack-transport:jar:5.4.3: Failed to read artifact descriptor for org.elasticsearch.client:x-pack-transport:jar:5.4.3: Could not transfer artifact org.elasticsearch.client:x-pack-transport:pom:5.4.3 from/to elasticsearch-releases ([https://artifacts.elastic.co/maven](https://artifacts.elastic.co/maven)): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -\> [Help 1]**  
**org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project my-app: Could not resolve dependencies for project com.mycompany.app:my-app:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.elasticsearch.client:x-pack-transport:jar:5.4.3**  
\*\* at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)\*\*  
\*\* at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)\*\*

Downloading the jar "x-pack-transport-5.4.3.jar" and placing it in the class path has not helped.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 7, 2017, 1:16am UTC](https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179/2 "2017-07-07T01:16:43Z")

</div>

This looks like it is the same problem you had [here](https://discuss.elastic.co/t/x-pack-plugin-installation-issue-in-elastic-search/91689/4).

It looks like you are behind a proxy that is making a mess of your SSL certificates.

Can you check what certificate your web browser is using for our download site?  
If you are using Google Chrome with Dev Tools enabled, the steps to do that are:

**(1)** Open [https://artifacts.elastic.co/maven](https://artifacts.elastic.co/maven) in Chrome  
**(2)** Right click on the page and select `Inspect`  
**(3)** In the _Dev Tools_ window, click the `Security` tab  
**(4)** Click the `View certificate` button  
**(5)** The certificate should say:

```auto
*.elastic.co
Issued by: DigiCert SHA2 Secure Server CA

```

**(6)** Expand the `> Details` section in that same popup, and then scroll to the very bottom  
**(7)** The fingerprints for the certificate should be:

```
SHA-256: 8 2E 31 1B D2 9C DF E4 18 78 C6 17 D5 CA E7 
SHA-1: FB C0 C2 71 9F 00 59 21 71 DF 50 DB A1 DF FD B8 56 21 D1 8F

```

If those details don't match what you see in your browser, then something in your corporate environment is causing your download problem and you'll need to discuss it with your internal network administrators.

---

<div class="post-metadata">

**Author:** ![gs21](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gs21](https://discuss.elastic.co/u/gs21)\
**Post date:** [July 7, 2017, 3:29pm UTC](https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179/3 "2017-07-07T15:29:42Z")

</div>

Thanks a lot for the reply.

I followed the steps mentioned by you. Neither the issued by nor the foot prints are matching. We are in touch with our network team. It might take a day or 2 for approval or might not get an approval. Not sure as of now.

Do we know why the JAR downloaded using the following site is not working  
"[https://www.elastic.co/guide/en/x-pack/current/api-java.html](https://www.elastic.co/guide/en/x-pack/current/api-java.html)"

Why it is throwing the following exception  
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.xpack.XPackPlugin

Will the maven dependency will download more than 1 jar to resolve the issue ?

---

<div class="post-metadata">

**Author:** ![gs21](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gs21](https://discuss.elastic.co/u/gs21)\
**Post date:** [July 7, 2017, 9:07pm UTC](https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179/4 "2017-07-07T21:07:22Z")

</div>

Hello Elastic Team

Thanks for the help.

Certificate issue is solved by my network team. I have downloaded the dependency JAR for x-pack

```
<repositories>
  <!--add the elasticsearch repo-->
  <repository>
     <id>elasticsearch-releases</id>
     <url>https://artifacts.elastic.co/maven</url>
     <releases>
        <enabled>true</enabled>
     </releases>
     <snapshots>
        <enabled>false</enabled>
     </snapshots>
  </repository>

```

```
  <dependency>
     <groupId>org.elasticsearch.client</groupId>
     <artifactId>transport</artifactId>
     <version>5.4.3</version>
  </dependency>

  <!--add the x-pack jar as a dependency-->
  <dependency>
     <groupId>org.elasticsearch.client</groupId>
     <artifactId>x-pack-transport</artifactId>
     <version>5.4.3</version>
  </dependency>
  
  <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
	<groupId>org.apache.logging.log4j</groupId>
	<artifactId>log4j-api</artifactId>
	<version>2.7</version>
</dependency>

```

---

<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:** [August 4, 2017, 9:07pm UTC](https://discuss.elastic.co/t/x-pack-transport-jar-dependency-down-load-issue/92179/5 "2017-08-04T21:07:47Z")

</div>

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