title: java.lang.ClassCastException:ObjectName$$anon$1 cannot be cast to com.fasterxml.jackson.module.scala.ScalaObjectMapper
body: <p>I am using: <code>&lt;jackson.version&gt;2.11.2&lt;/jackson.version&gt;</code>
  and <code>&lt;scala.version&gt;2.11.12&lt;/scala.version&gt;</code></p>
  <p>pom file:</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-module-scala_${scala.version.major}&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;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-annotations&lt;/artifactId&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;/dependency&gt;
  </code></pre>
  <p>I am having the following error:</p>
  <pre><code>Caused by: java.lang.ClassCastException: com.sample.ObjectName$$anon$1 cannot be cast to com.fasterxml.jackson.module.scala.ScalaObjectMapper
  at com.fasterxml.jackson.module.scala.ScalaObjectMapper$class.$init$(ScalaObjectMapper.scala:338)
  at com.sample.ObjectName$$anon$1.&lt;init&gt;(ObjectName.scala:22)
  </code></pre>
  <p>at this line(updated import statements below for more info):</p>
  <pre><code>import com.fasterxml.jackson.databind.ObjectMapper
  import com.fasterxml.jackson.module.scala.DefaultScalaModule
  import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
  val mapper = new ObjectMapper() with ScalaObjectMapper
  mapper.registerModule(DefaultScalaModule)
  mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
  def toMap[V](json:String)(implicit m: Manifest[V]): Map[String, Any] = fromJson[Map[String,Any]](json)
  def fromJson[T](json: String)(implicit m : Manifest[T]): T = {
      mapper.readValue[T](json)
  }
  def toJson(value: Any): String = {
      mapper.writeValueAsString(value)
  }
  </code></pre>
  <p>Anyone else faced the same issue? Any suggestions for the same?</p>