title: com-esotericsoftware-kryo-io-unsafeoutput-error-while-creating-spark-session
body: <p>I am working on <a href="https://github.com/capitalone/Hydrograph" rel="nofollow noreferrer">https://github.com/capitalone/Hydrograph</a>. 
  While upgrading Spark version to 2.2.1, I am seeing below error at line 89 in </p>
  
  <p><a href="https://github.com/capitalone/Hydrograph/blob/master/hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/flow/HydrographRuntime.scala" rel="nofollow noreferrer">https://github.com/capitalone/Hydrograph/blob/master/hydrograph.engine/hydrograph.engine.spark/src/main/scala/hydrograph/engine/spark/flow/HydrographRuntime.scala</a></p>
  
  <pre><code>Caused by: java.lang.NoClassDefFoundError: com/esotericsoftware/kryo/io/UnsafeOutput
    at org.apache.spark.serializer.SerializerManager.&lt;init&gt;(SerializerManager.scala:42)
    at org.apache.spark.SparkEnv$.create(SparkEnv.scala:289)
    at org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:175)
    at org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:257)
    at org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:432)
    at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2516)
    at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:918)
    at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:910)
    at scala.Option.getOrElse(Option.scala:121)
    at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:910)
  </code></pre>
  
  <p>I don't have much support for this tool now and recently took over working on it. Any pointers for solution of this problem will be helpful?</p>
  
  <p>SOLUTION: Add following dependency in build.gradle file</p>
  
  <p>compile group: 'com.esotericsoftware', name: 'kryo', version: '4.0.1'</p>