I've got the following code that is meant to parse the following JSON string with Jerkson, the Scala wrapper for Jackson:
Code: val vertex = Json.parse[Ranked[UserVertex]](rawString)
Json: "originalPos":"515693049","rankScore":1.2409032357406248E8,"ranked":{"userId":"101010110","userName":"John","channel":"thirtyfive"}}
The following JSON is represented by this Scala class:
case class Ranked[T] (
val originalPos: String,
val rankScore: Double,
val ranked: T
)
and T is a UserVertex
class with the following fields above (userId, userName, channel). When I try to parse the JSON string I get the following error:
[error] application - Could not parse the string:
{"originalPos":"655330261","rankScore":1.2423105672295567E8,"ranked":{"userId":"655330261","userName":"Sheile Mercado-Mallari","channel":"facebook"}}
java.lang.ClassNotFoundException: T
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.codahale.jerkson.util.CaseClassSigParser$.loadClass(CaseClassSigParser.scala:153)
It looks like the ClassLoader can't find the class, but it's definitely loaded. Any idea what the root cause of this is? Do I have some sort of multiple class loader issue here? Thanks!