# XPackPlugin Class Not Found

**URL:** https://discuss.elastic.co/t/xpackplugin-class-not-found/84364
**Category:** Elasticsearch
**Created:** [May 3, 2017, 7:42am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364 "2017-05-03T07:42:49Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 3, 2017, 7:42am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/1 "2017-05-03T07:42:49Z")

</div>

Team,

We are upgrading to ES 5.3.x and as a result, have included all the necessary dependencies as follows:

```
    compile "org.elasticsearch:elasticsearch:5.3.2" 
compile "org.elasticsearch.client:x-pack-transport:5.3.2"
compile "org.elasticsearch.client:transport:5.3.2"
compile "org.apache.logging.log4j:log4j-api:2.7"
compile "org.apache.logging.log4j:log4j-core:2.7"

```

We have fixed all the compilation issues. We are using Gradle to build our application. In grade we have this repo entry as well:  
maven { url "[https://artifacts.elastic.co/maven](https://artifacts.elastic.co/maven)" }

However, I am trying to start the application it fails with the below exception:

Caused by: java.lang.ClassNotFoundException: org.elasticsearch.xpack.XPackPlugin  
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0\_66]  
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0\_66]  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0\_66]  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0\_66]  
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:55) ~[x-pack-transport-5.3.2.jar:5.3.2]  
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:50) ~[x-pack-transport-5.3.2.jar:5.3.2]  
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.(PreBuiltXPackTransportClient.java:46) ~[x-pack-transport-5.3.2.jar:5.3.2]

I have read few posts and it seems there is some issue while downloading the transitive dependencies for x-pack.

Please let me know how to go about this now and I am not even able to find the XPackPlugin jar anywhere so that I can manually upload to our local nexus repo and make it work.

Need help asap.

Thanks much guys !

Arun

---

<div class="post-metadata">

### Author: ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)
#### Post date: [May 3, 2017, 8:39pm UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/2 "2017-05-03T20:39:24Z")

</div>

When you say you use gradle, do you mean Elasticsearch's `build-tools` gradle plugin, or just gradle in general? If using `build-tools`, transitive dependencies are disabled (this is how we prefer to handle all dependencies so that we know exactly which jars we are pulling in). The jar file containing XPackPlugin is `org.elasticsearch.plugin:x-pack-api`, which is a dependency of `x-pack-transport`.

---

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 4, 2017, 1:20am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/3 "2017-05-04T01:20:20Z")

</div>

Hi Ryan,

Thanks for your reply. I intended to mean Gradle in general. When we clean build our project using Gradle (./gradlew clean build), it downloads all the transient dependencies of x-pack-transport (5.3.2). However, it does not pull the x-pack-api. I am not sure if I'm missing something here or there is a problem somewhere else.

compile "org.elasticsearch.client:x-pack-transport:5.3.2"

I even tried downloading x-pack-plugin in the following manner:

compile "org.elasticsearch.plugin:x-pack-api:5.3.2"

Even the above command doesn't seem to find any x-pack-api jars.

Please let me know what other ways I can try or where I can download the x-pack-api jar directly.

Appreciate your help in this.

---

<div class="post-metadata">

### Author: ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)
#### Post date: [May 4, 2017, 2:45am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/4 "2017-05-04T02:45:42Z")

</div>

I created a very simple build file which compiles fine for me. Can you compare to what you have?

My `build.gradle`:

```auto
apply plugin: 'java'

repositories {
  mavenCentral()
  maven {
    url 'https://artifacts.elastic.co/maven'
  }
}

dependencies {
  compile 'org.elasticsearch.client:x-pack-transport:5.3.2'
}

```

And my compile output, showing x-pack-api is downloading:

```auto
:compileJava
Download https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/5.3.2/x-pack-transport-5.3.2.jar
Download https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack-api/5.3.2/x-pack-api-5.3.2-jar
Download https://repo1.maven.org/maven2/org/elasticsearch/client/transport/5.3.2/transport-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/plugin/transport-netty3-client/5.3.2/transport-netty3-client-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/plugin/transport-netty4-client/5.3.2/transport-netty4-client-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/client/rest/5.3.2/rest-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/client/sniffer/5.3.2/sniffer-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/5.3.2/elasticsearch-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/plugin/reindex-client/5.3.2/reindex-client-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/plugin/lang-mustache-client/5.3.2/lang-mustache-client-5.3.2.jar
Download https://repo1.maven.org/maven2/org/elasticsearch/plugin/percolator-client/5.3.2/percolator-client-5.3.2.jar
:processResources NO-SOURCE
:classes
:jar
:assemble

BUILD SUCCESSFUL

```

---

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 4, 2017, 5:35am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/5 "2017-05-04T05:35:01Z")

</div>

Great! My config also look the same. Let me double check and try to see what's going wrong.

---

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 4, 2017, 5:54am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/6 "2017-05-04T05:54:36Z")

</div>

For me it just downloads these:

ownload [http://nexus-us.in.fixstream.com:8081/nexus/content/groups/public/org/elasticsearch/client/x-pack-transport/5.3.2/x-pack-transport-5.3.2.pom](http://nexus-us.in.fixstream.com:8081/nexus/content/groups/public/org/elasticsearch/client/x-pack-transport/5.3.2/x-pack-transport-5.3.2.pom)  
Download [http://nexus-us.in.fixstream.com:8081/nexus/content/groups/public/org/elasticsearch/client/x-pack-transport/5.3.2/x-pack-transport-5.3.2.jar](http://nexus-us.in.fixstream.com:8081/nexus/content/groups/public/org/elasticsearch/client/x-pack-transport/5.3.2/x-pack-transport-5.3.2.jar)

POM:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.elasticsearch.client</groupId>
  <artifactId>x-pack-transport</artifactId>
  <version>5.3.2</version>
  <description>POM was created by Sonatype Nexus</description>
</project>

```

---

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 4, 2017, 5:58am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/7 "2017-05-04T05:58:37Z")

</div>

```auto
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.elasticsearch.client</groupId>
  <artifactId>x-pack-transport</artifactId>
  <version>5.3.2</version>
  <description>POM was created by Sonatype Nexus</description>
</project>

```

---

<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: [May 4, 2017, 6:20am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/8 "2017-05-04T06:20:43Z")

</div>

I think you did not add the following repo to your company nexus:

```auto
   <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>
   </repositories>

```

See [https://www.elastic.co/guide/en/x-pack/current/java-clients.html](https://www.elastic.co/guide/en/x-pack/current/java-clients.html)

---

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 4, 2017, 8:32am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/9 "2017-05-04T08:32:24Z")

</div>

I am not sure about the pom.xml of nexus but I tried adding the above repo directly from Nexus UI. Even though it says in service but it is not able to pull any data from the https:// url.

Attached is the snapshot below.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c1cce5fff699848401e3058f957aa1d945f68abd.png)

---

<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: [May 4, 2017, 1:51pm UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/10 "2017-05-04T13:51:45Z")

</div>

I think you need to clean existing files in your nexus repo under `/nexus/content/groups/public/org/elasticsearch/client/x-pack-transport/5.3.2/`.

Here is how I added it for a test a while ago. It was a proxy.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/a/da26d5a96e33e79199af2f97813f7fd37658ad8f.jpg)

Note that this elastic repo does not contain any index so you should better set "download remote indexes" to false.

---

<div class="post-metadata">

### Author: ![arun-narayan](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@arun-narayan](https://discuss.elastic.co/u/arun-narayan)
#### Post date: [May 5, 2017, 5:25am UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/11 "2017-05-05T05:25:19Z")

</div>

Thanks David !!

Unfortunately, something is messed up at my end. I have tried everything possible now 🙂 So I manually downloaded all the jars somehow and uploaded them to my local nexus. We are good for now !

Appreciate yours and Ryan's quick help on this.

---

<div class="post-metadata">

### Author: ![pravin\_prabhat](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@pravin\_prabhat](https://discuss.elastic.co/u/pravin_prabhat)
#### Post date: [May 31, 2017, 4:01pm UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/12 "2017-05-31T16:01:13Z")

</div>

elasticsearch repo doesn't work with nexus2.  
It works with nexus3 only.

---

<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: [June 28, 2017, 4:01pm UTC](https://discuss.elastic.co/t/xpackplugin-class-not-found/84364/13 "2017-06-28T16:01:37Z")

</div>

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