【问题标题】:Spray's integration with ideaSpray与idea的结合
【发布时间】:2015-09-02 11:09:17
【问题描述】:

我有一个简单的喷雾服务演员

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)
          }
        }
      }
    }
  }
}

AService 的 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]]]

我做错了什么?

【问题讨论】:

    标签: scala intellij-idea spray


    【解决方案1】:

    已解决

    问题在于没有隐式执行上下文。 恕我直言,错误消息可能会更好

    【讨论】:

      猜你喜欢
      • 2019-04-25
      • 2011-10-28
      • 2017-06-10
      • 2013-10-09
      • 2013-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多