title: Can't connect to AWS rekognition API from IntelliJ
body: <p>I've been playing with the new rekognition API from Amazon and I am having trouble running their <a href="http://docs.aws.amazon.com/rekognition/latest/dg/get-started-exercise-detect-faces.html" rel="nofollow noreferrer">example</a> Java application from IntelliJ.  I'm using Maven to build the project and have included the AWS SDK in my <code>pom.xml</code> as follows:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
      &lt;artifactId&gt;aws-java-sdk&lt;/artifactId&gt;
      &lt;version&gt;${aws-java-sdk.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>From what I can tell, my application seems to be failing somewhere around here:</p>
  
  <pre><code>AmazonRekognitionClient rekognitionClient = new AmazonRekognitionClient(credentials)
          .withEndpoint("s3-us-west-2.amazonaws.com");
  rekognitionClient.setSignerRegionOverride("us-west-2");
  try {
      DetectFacesResult result = rekognitionClient.detectFaces(request);
      ObjectMapper objectMapper = new ObjectMapper();
      System.out.println("Result = " + objectMapper.writeValueAsString(result));
  } catch (AmazonRekognitionException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>...And the error that I'm getting is:</p>
  
  <pre><code>com.amazonaws.services.rekognition.model.AmazonRekognitionException: null (Service: AmazonRekognition; Status Code: 400; Error Code: null; Request ID: null)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1545)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1183)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:964)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:676)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:650)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:633)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$300(AmazonHttpClient.java:601)
      at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:583)
      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:447)
      at com.amazonaws.services.rekognition.AmazonRekognitionClient.doInvoke(AmazonRekognitionClient.java:1130)
      at com.amazonaws.services.rekognition.AmazonRekognitionClient.invoke(AmazonRekognitionClient.java:1106)
      at com.amazonaws.services.rekognition.AmazonRekognitionClient.detectFaces(AmazonRekognitionClient.java:599)
      at com.github.jhenningsgaard.DetectFaces.main(DetectFaces.java:39)
      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:498)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
  </code></pre>
  
  <p>I should also note that I ran the operation (see below) in AWS CLI and was successful.</p>
  
  <pre><code>aws rekognition detect-faces \
  --image '{"S3Object":{"Bucket":"Bucketname","Name":"s3ObjectKey"}}' \
  --attributes "ALL" \
  --region us-east-1 \
  --profile adminuser
  </code></pre>