title: Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.ObjectIdResolver with spark 2.1.0
body: <p><strong>i'm trying connect my spark (local) with S3. below is the spark configuration. while reading a file from S3 bucket using a RDD facing the below issue.</strong></p>
  
  <p>spark 2.1.0 configuration and code snippet to read the text file from S3</p>
  
  <pre><code>SparkSession session = SparkSession.builder().master("local")
      .config("spark.hadoop.fs.s3a.access.key", accessKey)
      .config("spark.hadoop.fs.s3a.secret.key",secretKey)
      .config("spark.hadoop.fs.s3a.impl","org.apache.hadoop.fs.s3native.NativeS3AFileSystem")
      .getOrCreate();
  RDD&lt;String&gt; data = session.sparkContext().textFile("s3a://mybucket//filename",1);
  </code></pre>
  
  <p>error at runtime:</p>
  
  <pre><code>java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at org.apache.spark.metrics.MetricsSystem$$anonfun$registerSinks$1.apply(MetricsSystem.scala:200)
  at org.apache.spark.metrics.MetricsSystem$$anonfun$registerSinks$1.apply(MetricsSystem.scala:194)
  at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
  at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
  at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:230)
  at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
  at scala.collection.mutable.HashMap.foreach(HashMap.scala:99)
  at org.apache.spark.metrics.MetricsSystem.registerSinks(MetricsSystem.scala:194)
  at org.apache.spark.metrics.MetricsSystem.start(MetricsSystem.scala:102)
  at org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:522)
  at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2313)
  at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:868)
  at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:860)
  at scala.Option.getOrElse(Option.scala:121)
  at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:860)
  at 
  Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/ObjectIdResolver
  at com.fasterxml.jackson.databind.ObjectMapper.&lt;init&gt;(ObjectMapper.java:543)
  at com.fasterxml.jackson.databind.ObjectMapper.&lt;init&gt;(ObjectMapper.java:448)
  at org.apache.spark.metrics.sink.MetricsServlet.&lt;init&gt;(MetricsServlet.scala:48)
  ... 20 more
  Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.ObjectIdResolver
  at java.net.URLClassLoader.findClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 23 more
  
  **And i also tried adding a dependencies jackson-core in POM but thrown the below error**
  
  Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.module.scala.deser.BigDecimalDeserializer$.handledType()Ljava/lang/Class;
  at com.fasterxml.jackson.module.scala.deser.NumberDeserializers$.&lt;init&gt;(ScalaNumberDeserializersModule.scala:49)
  at com.fasterxml.jackson.module.scala.deser.NumberDeserializers$.&lt;clinit&gt;(ScalaNumberDeserializersModule.scala)
  at com.fasterxml.jackson.module.scala.deser.ScalaNumberDeserializersModule$class.$init$(ScalaNumberDeserializersModule.scala:61)
  at com.fasterxml.jackson.module.scala.DefaultScalaModule.&lt;init&gt;(DefaultScalaModule.scala:20)
  at com.fasterxml.jackson.module.scala.DefaultScalaModule$.&lt;init&gt;(DefaultScalaModule.scala:37)
  at com.fasterxml.jackson.module.scala.DefaultScalaModule$.&lt;clinit&gt;(DefaultScalaModule.scala)
  at org.apache.spark.rdd.RDDOperationScope$.&lt;init&gt;(RDDOperationScope.scala:82)
  at org.apache.spark.rdd.RDDOperationScope$.&lt;clinit&gt;(RDDOperationScope.scala)
  at org.apache.spark.SparkContext.withScope(SparkContext.scala:701)
  at org.apache.spark.SparkContext.textFile(SparkContext.scala:819)
  </code></pre>
  
  <p>Pom.xml</p>
  
  <pre><code>**
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
      &lt;artifactId&gt;spark-core_2.11&lt;/artifactId&gt;
      &lt;version&gt;2.1.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
      &lt;artifactId&gt;aws-java-sdk&lt;/artifactId&gt;
      &lt;version&gt;1.7.4&lt;/version&gt;
      &lt;scope&gt;import&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
      &lt;artifactId&gt;hadoop-aws&lt;/artifactId&gt;
      &lt;version&gt;2.7.3&lt;/version&gt;
      &lt;scope&gt;import&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
      &lt;version&gt;2.2.3&lt;/version&gt;
      &lt;scope&gt;import&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
      &lt;version&gt;2.2.3&lt;/version&gt;
      &lt;scope&gt;import&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
      &lt;version&gt;2.2.3&lt;/version&gt;
      &lt;scope&gt;import&lt;/scope&gt;
  &lt;/dependency&gt;
  
  **   
  </code></pre>
  
  <p>need a solution to resolve this issue!, Thanks in Advance</p>