-
4 votesanswersviews
喷洒Akka Json Unmarshalling
我有一个问题,通过使用spray - akka将对象解组到Json . 当我想使用返回Future [List [Person]]的actor时,它不起作用 . 如果我直接使用dao对象,它的工作原理 . 这是我的代码: PersonDao.scala import scala.concurrent.ExecutionContext.Implicits.global import scala.... -
3 votesanswersviews
unmarshall嵌套json in spray-json
使用spray-json(因为我正在使用spray-client)来获取google maps API中的纬度,经度对象,我需要设置整个响应结构: case class AddrComponent(long_name: String, short_name: String, types: List[String]) case class Location(lat: Double, lng: Dou... -
2 votesanswersviews
AbstractMethodError使用spray和akka
我想用喷雾和akka制作一些web服务 . GET请求工作正常(获取元素列表,值...使用spray-json)但是我的身份验证请求,我得到了一个预测,我不知道为什么 . 我做了一些单元测试,看看序列化/反序列化是否适用于marshallers,我看到一个格式良好的json对象 . 这是我的堆栈跟踪: Uncaught error from thread [on-spray-can-akka.a... -
4 votesanswersviews
不能用喷射json来解散json HttpEntity
我试图只运行documentation中的简单示例而不做任何更改: import spray.json.DefaultJsonProtocol import spray.httpx.unmarshalling._ import spray.httpx.marshalling._ import spray.http._ import HttpCharsets._ import MediaTypes.... -
3 votesanswersviews
akka spray:java.lang.IllegalArgumentException:要求失败
我是akka喷雾中的新人:) 我有这个路由器演员: class ProjectResource extends HttpServiceActor with DefaultJsonFormats { import spray.http.MediaTypes.`application/json` def receive = runRoute { pathPrefix("r... -
1 votesanswersviews
喷雾中的解组json
我想解组json字符串 . 但最终会出错 . 无法正确理解错误 . 以下是代码: import akka.actor.ActorSystem import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport import akka.http.scaladsl.unmarshalling.Unmarshal import akka.st... -
0 votesanswersviews
akka spray - > akka http migration
这是我的路由器在基于喷雾的服务中的片段: path(baseUrl / version / "apps" / Segment / "users" / Segment) { (app, user) => respondWithMediaType(MediaTypes.`application/json`) { ctx => create... -
0 votesanswersviews
spray-json反序列化问题
case class Box(id: String, container: Container) case class Container(id: String, boxes: List[Box]) object CustomProtocol extends DefaultJsonProtocol { implicit object BoxFormat extends RootJ...