title: User class threw exception: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.JsonMappingException
body: <p>I get the following error when I run my Spark Scala program:</p>
  
  <blockquote>
    <p>User class threw exception: java.lang.NoSuchMethodError:
    com.fasterxml.jackson.databind.JsonMappingException.(Ljava/io/Closeable;Ljava/lang/String;)V</p>
  </blockquote>
  
  <p>The particular line which throws the error is <code>val configString = UtilsKPI.downloadFromS3(configPath)</code>.</p>
  
  <p>This is the code of <code>UtilsKPI</code>.</p>
  
  <pre><code>object UtilsKPI {
  
    var bucketNameCode: String = ""
    var bucketNameData: String = ""
    var credentials: BasicAWSCredentials = null
    var client: AmazonS3Client = null
  
    def parseJSON(line: String): Map[String, String] = {
      JacksMapper.readValue[Map[String, String]](line)
    }
  
    def setBucketNameCode(bnc: String): Unit = {
      bucketNameCode = bnc
    }
  
  
    def setBucketNameData(bnd: String): Unit = {
      bucketNameData = bnd
    }
  
    def setS3(): Unit = {
      client = new AmazonS3Client()
    }
  
    def convertMapToJSON(map: Map[String, Any]): String = {
      val json = JacksMapper.writeValueAsString[scala.collection.immutable.Map[String, Any]](map)
      json
    }
  
    def uploadConfigToS3(config: String, filePath: String): Unit = {
      val CONTENT_TYPE = "application/json"
      val fileContentBytes = config.getBytes(StandardCharsets.UTF_8)
      val fileInputStream = new ByteArrayInputStream(fileContentBytes)
      val metadata = new ObjectMetadata()
      metadata.setContentType(CONTENT_TYPE)
      metadata.setContentLength(fileContentBytes.length)
      val putObjectRequest = new PutObjectRequest(bucketNameCode, filePath, fileInputStream, metadata)
      client.deleteObject(new DeleteObjectRequest(bucketNameCode, filePath))
      client.putObject(putObjectRequest)
    }
  
    def downloadFromS3(downloadFile: String): String = {
      val s3Object = client.getObject(new GetObjectRequest(bucketNameCode, downloadFile))
      val myData = Source.fromInputStream(s3Object.getObjectContent())
      myData.getLines().mkString("\n")
    }
  
  
    def getByKeyFromS3(key: String): String = {
      val s3Object = client.getObject(bucketNameData, key)
      val myData = Source.fromInputStream(s3Object.getObjectContent())
      myData.getLines().mkString("\n")
    }
  
  }
  </code></pre>
  
  <p>This is my pom.xml file:</p>
  
  <pre><code>&lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;scala.version&gt;2.11&lt;/scala.version&gt;
          &lt;scala.subversion&gt;2.11.8&lt;/scala.subversion&gt;
          &lt;spark.version&gt;2.2.0&lt;/spark.version&gt;
          &lt;jackson.version&gt;2.9.4&lt;/jackson.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
              &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
              &lt;version&gt;${scala.subversion}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
              &lt;artifactId&gt;spark-sql_${scala.version}&lt;/artifactId&gt;
              &lt;version&gt;${spark.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-module-scala_${scala.version}&lt;/artifactId&gt;
              &lt;version&gt;${jackson.version}&lt;/version&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;${jackson.version}&lt;/version&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;${jackson.version}&lt;/version&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;${jackson.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.github.nscala-time&lt;/groupId&gt;
              &lt;artifactId&gt;nscala-time_${scala.version}&lt;/artifactId&gt;
              &lt;version&gt;2.18.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.github.scopt&lt;/groupId&gt;
              &lt;artifactId&gt;scopt_${scala.version}&lt;/artifactId&gt;
              &lt;version&gt;3.3.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
              &lt;artifactId&gt;aws-java-sdk-s3&lt;/artifactId&gt;
              &lt;version&gt;1.11.297&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.typesafe.scala-logging&lt;/groupId&gt;
              &lt;artifactId&gt;scala-logging_${scala.version}&lt;/artifactId&gt;
              &lt;version&gt;3.8.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
              &lt;artifactId&gt;spark-streaming-kafka-0-8_${scala.version}&lt;/artifactId&gt;
              &lt;version&gt;${spark.version}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>