lift-json

spark-core 1.6.1 & lift-json 2.6.3 java.lang.NoClassDefFoundError

天大地大妈咪最大 提交于 2019-12-04 20:22:17
I have a Spark application which has a sbt file just like below. It works on my local machine. But when I submit it to EMR running Spark 1.6.1, an error occured like below: java.lang.NoClassDefFoundError: net/liftweb/json/JsonAST$JValue I am using "sbt-package" to get jar Build.sbt: organization := "com.foo" name := "FooReport" version := "1.0" scalaVersion := "2.10.6" libraryDependencies ++= Seq( "org.apache.spark" %% "spark-core" % "1.6.1" ,"net.liftweb" % "lift-json_2.10" % "2.6.3" ,"joda-time" % "joda-time" % "2.9.4" ) Do you have any idea about what’s happening? I' ve found a solution and

Lift-json extract json with 'type' field into a case class

空扰寡人 提交于 2019-12-04 01:50:41
I am trying to extract JSON into a case class using lift-json. Here is my case class: case class Person(name: String, age: Int) Here is the json { "name": "Some Name", "age": 24, type: "Student" } How can I extract the type field into an instance Person ? json.extract[Person] Backticks allow you to use reserved names. case class Person(name:String, age:Int, `type`:String) 来源: https://stackoverflow.com/questions/7462493/lift-json-extract-json-with-type-field-into-a-case-class

Polymorphic lift-json deserialization in a composed class

☆樱花仙子☆ 提交于 2019-12-03 13:25:08
问题 I am trying to automatically deserialize json object to a scala class using Lift-Json with a coordinate class inside used to store GeoJson information. case class Request(name:String, geometry:Geometry) sealed abstract class Geometry case class Point(coordinates:(Double,Double)) extends Geometry case class LineString(coordinates:List[Point]) extends Geometry case class Polygon(coordinates:List[LineString]) extends Geometry I want to deserialize a json string like this: { name:"test", geometry

Polymorphic lift-json deserialization in a composed class

雨燕双飞 提交于 2019-12-03 03:26:12
I am trying to automatically deserialize json object to a scala class using Lift-Json with a coordinate class inside used to store GeoJson information. case class Request(name:String, geometry:Geometry) sealed abstract class Geometry case class Point(coordinates:(Double,Double)) extends Geometry case class LineString(coordinates:List[Point]) extends Geometry case class Polygon(coordinates:List[LineString]) extends Geometry I want to deserialize a json string like this: { name:"test", geometry:{ "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] } } into a Request case class

Scala 2.10 + Json serialization and deserialization

不羁的心 提交于 2019-11-28 03:49:20
Scala 2.10 seems to have broken some of the old libraries (at least for the time being) like Jerkson and lift-json. The target usability is as follows: case class Person(name: String, height: String, attributes: Map[String, String], friends: List[String]) //to serialize val person = Person("Name", ....) val json = serialize(person) //to deserialize val sameperson = deserialize[Person](json) But I'm having trouble finding good existing ways of generating and deserializing Json that work with Scala 2.10. Are there best practice ways of doing this in Scala 2.10? Jackson is a Java library to

Scala 2.10 + Json serialization and deserialization

99封情书 提交于 2019-11-27 00:10:40
问题 Scala 2.10 seems to have broken some of the old libraries (at least for the time being) like Jerkson and lift-json. The target usability is as follows: case class Person(name: String, height: String, attributes: Map[String, String], friends: List[String]) //to serialize val person = Person("Name", ....) val json = serialize(person) //to deserialize val sameperson = deserialize[Person](json) But I'm having trouble finding good existing ways of generating and deserializing Json that work with