我有一个简单的喷雾服务演员
class SimplService(service: AService) extends HttpServiceActor
with MyJsonProtocol
with SprayJsonSupport {
override def receive: Receive = runRoute {
path("a") {
get {
parameter('param.as[String]) { p =>
complete {
service.foo(p)
}
}
}
}
}
}服务的foo方法返回Future[List[SomeClass]]在MyJsonProtocol(当然是从DefaultJsonProtocol扩展而来)中为SomeClass声明了一个隐含的jsonFormat
当在intellij idea中运行时,我得到这样的编译时错误
could not find implicit value for parameter marshaller: spray.httpx.marshalling.ToResponseMarshaller[scala.concurrent.Future[List[SomeClass]]]我哪里做错了?
发布于 2015-09-02 21:25:53
已解决的
问题在于缺少隐式的执行上下文。IMHO,错误消息可能更好
https://stackoverflow.com/questions/32351517
复制相似问题