title: Elastic Search java.lang.NoClassDefFoundError: org/elasticsearch/transport/Netty3Plugin
body: <p>I am trying to get familiar with elasticsearch by making a basic program with its java api. I have been researching an answer for some time now, but I am not sure if I am executing the solutions I found incorrectly or just not seeing the real problem.</p>
  
  <p>I am using elasticsearch-5.1.1 and downloaded the most recent transport version (5.1.1). I also have added both (including all jar files that came with the elasticsearch download) in my project structure.</p>
  
  <p>Thanks in advance!</p>
  
  <p>When running my test file, I am getting the following error.</p>
  
  <p>Error:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/elasticsearch/transport/Netty3Plugin
  
  at org.elasticsearch.transport.client.PreBuiltTransportClient.&lt;clinit&gt;(PreBuiltTransportClient.java:54)
  at DictionarySearch.ElasticSearch.&lt;init&gt;(ElasticSearch.java:41)
  at test.TestIndexSearcher.verifyElasticSearch(TestIndexSearcher.java:64)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
  at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
  at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
  at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
  at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
  Caused by: java.lang.ClassNotFoundException: org.elasticsearch.transport.Netty3Plugin
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 30 more
  </code></pre>
  
  <p>I have added the following dependencies to my pom.xml file and installed xpack following the given <a href="http://elasticsearch.qiniudn.com/guide/en/x-pack/5.0/installing-xpack.html" rel="nofollow noreferrer">directions</a>. My pom.xml is location in src/lib along with my log4j2.xml file.</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;org.elasticsearch.client&lt;/groupId&gt;
  &lt;artifactId&gt;transport&lt;/artifactId&gt;
  &lt;version&gt;5.1.1&lt;/version&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;elasticsearch-releases&lt;/id&gt;
          &lt;url&gt;https://maven.elasticsearch.org/releases&lt;/url&gt;
          &lt;releases&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.client&lt;/groupId&gt;
          &lt;artifactId&gt;x-pack-transport&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch&lt;/groupId&gt;
          &lt;artifactId&gt;elasticsearch-transport-wares&lt;/artifactId&gt;
          &lt;version&gt;2.7.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch&lt;/groupId&gt;
          &lt;artifactId&gt;elasticsearch&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.plugin&lt;/groupId&gt;
          &lt;artifactId&gt;transport-netty3-client&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
          &lt;version&gt;2.7&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
          &lt;version&gt;2.7&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.plugin&lt;/groupId&gt;
          &lt;artifactId&gt;transport-netty4-client&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.plugin&lt;/groupId&gt;
          &lt;artifactId&gt;reindex-client&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.plugin&lt;/groupId&gt;
          &lt;artifactId&gt;lang-mustache-client&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.elasticsearch.plugin&lt;/groupId&gt;
          &lt;artifactId&gt;percolator-client&lt;/artifactId&gt;
          &lt;version&gt;5.1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;inceptionYear&gt;2009&lt;/inceptionYear&gt;
  &lt;licenses&gt;
      &lt;license&gt;
          &lt;name&gt;The Apache Software License, Version 2.0&lt;/name&gt;
          &lt;url&gt;http://www.apache.org/licenses/LICENSE-2.0.txt&lt;/url&gt;
          &lt;distribution&gt;repo&lt;/distribution&gt;
      &lt;/license&gt;
  &lt;/licenses&gt;
  &lt;developers&gt;
      &lt;developer&gt;
          &lt;name&gt;Elastic&lt;/name&gt;
          &lt;url&gt;http://www.elastic.co&lt;/url&gt;
      &lt;/developer&gt;
  &lt;/developers&gt;
  &lt;name&gt;transport&lt;/name&gt;
  &lt;description&gt;Elasticsearch subproject :client:transport&lt;/description&gt;
  &lt;url&gt;https://github.com/elastic/elasticsearch&lt;/url&gt;
  &lt;scm&gt;
      &lt;url&gt;git@github.com:elastic/elasticsearch.git&lt;/url&gt;
  &lt;/scm&gt;
  </code></pre>
  
  <p></p>