title: Spark s3 read gives NullPointerException
body: <p>I am trying to process files from S3 file system. I have exported the <code>AWS_ACCESS_KEY_ID</code> and <code>AWS_SECRET_ACCESS_KEY</code>. I have also set the configuration </p>
  
  <pre><code>hadoopConf.set("fs.s3.awsAccessKeyId","&lt;key&gt;")  
  hadoopConf.set("fs.s3.awsSecretAccessKey","&lt;secret&gt;")
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>[error] (run-main-0) java.lang.NullPointerException
  java.lang.NullPointerException
      at org.apache.hadoop.fs.s3native.NativeS3FileSystem.listStatus(NativeS3FileSystem.java:479)
      at org.apache.hadoop.fs.Globber.listStatus(Globber.java:69)
      at org.apache.hadoop.fs.Globber.glob(Globber.java:217)
      at org.apache.hadoop.fs.FileSystem.globStatus(FileSystem.java:1642)
      at org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(FileInputFormat.java:257)
      at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:228)
      at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:304)
      at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:207)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)
      at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
  </code></pre>
  
  <p><strong>build.sbt</strong>  My build.sbt has the following dependencies</p>
  
  <pre><code>libraryDependencies += "org.apache.spark" %% "spark-core" % "1.5.1"
  
  libraryDependencies += "org.apache.hadoop" % "hadoop-client" % "2.4.0"
  
  libraryDependencies += "net.java.dev.jets3t" % "jets3t" % "0.9.3"
  </code></pre>
  
  <p>I use AWS IAM for the access keys. Am I missing something?</p>
  
  <p>Any help would be greatly appreciated.</p>