title: Exception in thread "main" java.lang.NoClassDefFoundError: com/amazonaws/endpointdiscovery/EndpointDiscoveryProviderChain
body: <p>I am working on a tool that will pull data from dynamoDB and following steps in  <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ScanJavaDocumentAPI.html" rel="nofollow noreferrer">this tutorial</a> <br/>
  So I have the following code:</p>
  
  <pre><code>package dynamodbtocsvfile;
  
  import java.util.Map;
  
  import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
  import com.amazonaws.services.dynamodbv2.model.AttributeValue;
  import com.amazonaws.services.dynamodbv2.model.ScanRequest;
  import com.amazonaws.services.dynamodbv2.model.ScanResult;
  import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
  
  public class dynamoDbScan {
  
      public dynamoDbScan() {}
  
      public static void main(String[] args) {
          AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard().build();
  
          ScanRequest scanRequest = new ScanRequest()
              .withTableName("Reply");
  
          ScanResult result = client.scan(scanRequest);
          for (Map&lt;String, AttributeValue&gt; item : result.getItems()){
              System.out.println(item);
          }
      }
  
  }
  </code></pre>
  
  <p>Here are my pom.xml dependencies:</p>
  
  <pre><code>&lt;dependencies&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
      &lt;artifactId&gt;commons-csv&lt;/artifactId&gt;
      &lt;version&gt;1.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
      &lt;artifactId&gt;aws-java-sdk-core&lt;/artifactId&gt;
      &lt;version&gt;1.11.24&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
      &lt;artifactId&gt;aws-java-sdk-dynamodb&lt;/artifactId&gt;
      &lt;version&gt;1.11.456&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p></p>
  
  <p>The file builds with no error, however, when I run it, I am getting the following error:</p>
  
  <pre><code>    Exception in thread "main" java.lang.NoClassDefFoundError: com/amazonaws/endpointdiscovery/EndpointDiscoveryProviderChain
      at dynamodbtocsv4j.dynamoDbScan.main(dynamoDbScan.java:16)
  Caused by: java.lang.ClassNotFoundException: com.amazonaws.endpointdiscovery.EndpointDiscoveryProviderChain
      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)
      ... 1 more
  </code></pre>
  
  <p>Here is my .classpath file contents:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
      &lt;classpathentry kind="src" output="target/classes" path="main/java"&gt;
          &lt;attributes&gt;
              &lt;attribute name="optional" value="true"/&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="src" output="target/test-classes" path="src/test/java"&gt;
          &lt;attributes&gt;
              &lt;attribute name="optional" value="true"/&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="lib" path="C:/Users/USERNAME/.m2/repository/com/amazonaws/aws-java-sdk-dynamodb/1.11.456/aws-java-sdk-dynamodb-1.11.456.jar" sourcepath="C:/Users/USERNAME/.m2/repository/com/amazonaws/aws-java-sdk-dynamodb/1.11.456/aws-java-sdk-dynamodb-1.11.456-sources.jar"&gt;
          &lt;attributes&gt;
              &lt;attribute name="javadoc_location" value="jar:file:/C:/Users/USERNAME/.m2/repository/com/amazonaws/aws-java-sdk-dynamodb/1.11.456/aws-java-sdk-dynamodb-1.11.456-javadoc.jar!/"/&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
              &lt;attribute name="org.eclipse.jst.component.nondependency" value=""/&gt;
              &lt;attribute name="maven.groupId" value="com.amazonaws"/&gt;
              &lt;attribute name="maven.artifactId" value="aws-java-sdk-dynamodb"/&gt;
              &lt;attribute name="maven.version" value="1.11.456"/&gt;
              &lt;attribute name="maven.scope" value="compile"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="lib" path="C:/Users/USERNAME/.m2/repository/com/amazonaws/aws-java-sdk-core/1.11.24/aws-java-sdk-core-1.11.24.jar" sourcepath="C:/Users/USERNAME/.m2/repository/com/amazonaws/aws-java-sdk-core/1.11.24/aws-java-sdk-core-1.11.24-sources.jar"&gt;
          &lt;attributes&gt;
              &lt;attribute name="javadoc_location" value="jar:file:/C:/Users/USERNAME/.m2/repository/com/amazonaws/aws-java-sdk-core/1.11.24/aws-java-sdk-core-1.11.24-javadoc.jar!/"/&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
              &lt;attribute name="maven.groupId" value="com.amazonaws"/&gt;
              &lt;attribute name="maven.artifactId" value="aws-java-sdk-core"/&gt;
              &lt;attribute name="maven.version" value="1.11.24"/&gt;
              &lt;attribute name="maven.scope" value="compile"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="lib" path="C:/Users/USERNAME/.m2/repository/org/apache/commons/commons-csv/1.1/commons-csv-1.1.jar"/&gt;
      &lt;classpathentry kind="lib" path="C:/Users/USERNAME/.m2/repository/com/amazonaws/jmespath-java/1.11.66/jmespath-java-1.11.66.jar"/&gt;
      &lt;classpathentry kind="output" path="target/classes"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>