Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 映射到lift中的json序列化_Scala_Serialization_Lift - Fatal编程技术网

Scala 映射到lift中的json序列化

Scala 映射到lift中的json序列化,scala,serialization,lift,Scala,Serialization,Lift,我有以下两个案例类:主题和报告定义: 案例类Topicname:String,queryWords:Set[String] 案例类ReportdateRange:org.joda.time.Interval,queryWord:String,topics:Map[Topic,Boolean],allOtherTopics:Map[Topic,Boolean] 我有一个要序列化的报告列表:reports:list[Report],但它给了我一个scala.MatchError 问:我的反序列化有什

我有以下两个案例类:主题和报告定义: 案例类Topicname:String,queryWords:Set[String]

案例类ReportdateRange:org.joda.time.Interval,queryWord:String,topics:Map[Topic,Boolean],allOtherTopics:Map[Topic,Boolean]

我有一个要序列化的报告列表:reports:list[Report],但它给了我一个scala.MatchError

问:我的反序列化有什么问题?
我序列化列表[主题]很好。lift/scala在序列化映射时有问题吗?

默认情况下,映射有一个限制,需要字符串键。这个问题有一个解决方案:我决定使用Twitter的Chill库并序列化为二进制
..
val writer = new BufferedWriter(new FileWriter(file))
Serialization.write(reports, writer)      <--error right here
..
scala.MatchError: (Topic(steam,Set(steam)),true) (of class scala.Tuple2)
        at net.liftweb.json.Extraction$$anonfun$decompose$1.apply(Extraction.sca
la:82) ~[lift-json_2.10-2.5-RC6.jar:2.5-RC6]
..