title: Deserializing case classes with Jerkson (nested)
body: <p>Using a worksheet in the Eclipse Scala IDE (contains code and output).</p>
  
  <p>This simple code gives a <code>ClassNotFoundException</code>. For some reason, it can't seem to find the Address class.</p>
  
  <p>similar: <a href="https://stackoverflow.com/questions/13365186/deserializing-json-into-user-defined-case-classes-with-jerkson">Deserializing JSON into user-defined case classes with Jerkson</a> (But their issue has to do with the Play framework and a parsing error)</p>
  
  <pre><code>import com.codahale.jerkson.Json._
  
  object person {
  
    case class Address(city: String, state: String)
    case class Person(name: String, age: Int, addresses: Seq[Address])
  
    parse[Person]("""{"name":"James", "age":25, "addresses": [{"city":"New York", "state": "NY"}, {"city":"Brooklyn", "state": "NY"}]}""")
    //&gt; java.lang.ClassNotFoundException: &lt;empty&gt;.person.Address
    //|   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    //|   at java.security.AccessController.doPrivileged(Native Method)
    //|   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    //|   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    //|   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    //|   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    //|   at com.codahale.jerkson.util.CaseClassSigParser$.loadClass(CaseClassSigP
    //| arser.scala:186)
    //|   at com.codahale.jerkson.util.CaseClassSigParser$.typeRef2JavaType(CaseCl
    //| assSigParser.scala:143)
    //|   at com.codahale.jerkson.util.CaseClassSigParser$$anonfun$typeRef2JavaTyp
    //| e$1.apply(CaseClassSigParser.scala:146)
    //|   at com.codahale.jerkson.util.CaseClassSigParser$$anonfun$typeRef2JavaTyp
    //| e$1.apply(CaseClassSigParser.scala:146)
    //|   at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
    //| .scala:233)
    //|   
    //| Output exceeds cutoff limit.
  
  }
  </code></pre>