title: ERROR SparkContext: Error initializing SparkContext - Java + Eclipse + Spark
body: <p>Im starting now with Spark. Im trying some example projects and now im working with a project to read from a csv.
  The problem comes when i run the app. The console of eclipse tells me the following error:</p>
  
  <pre><code>18/09/19 05:00:48 ERROR MetricsSystem: Sink class org.apache.spark.metrics.sink.MetricsServlet cannot be instantiated
  18/09/19 05:00:48 ERROR SparkContext: Error initializing SparkContext.
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      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:909)
      at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:901)
      at scala.Option.getOrElse(Option.scala:121)
      at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:901)
      at com.mycsv.app.CSVFileAnalysisInSparkSQL.main(CSVFileAnalysisInSparkSQL.java:28)
  Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.empty()Lcom/fasterxml/jackson/annotation/JsonFormat$Value;
      at com.fasterxml.jackson.databind.cfg.MapperConfig.&lt;clinit&gt;(MapperConfig.java:50)
      at com.fasterxml.jackson.databind.ObjectMapper.&lt;init&gt;(ObjectMapper.java:543)
      at com.fasterxml.jackson.databind.ObjectMapper.&lt;init&gt;(ObjectMapper.java:460)
      at org.apache.spark.metrics.sink.MetricsServlet.&lt;init&gt;(MetricsServlet.scala:48)
      ... 20 more
  </code></pre>
  
  <p>My project code is the following:</p>
  
  <pre><code>final SparkSession sparkSession = SparkSession.builder().appName("Spark CSV").master("local[5]").getOrCreate();
  </code></pre>
  
  <p>What could be the problem with the SparkContext?
  Thank you and regards.</p>