akka spray:java.lang.IllegalArgumentException:需求失败

akka spray:java.lang.IllegalArgumentException:需求失败,akka,spray,spray-json,Akka,Spray,Spray Json,我是akka spray的新手:) 我有一个路由器演员: class ProjectResource extends HttpServiceActor with DefaultJsonFormats { import spray.http.MediaTypes.`application/json` def receive = runRoute { pathPrefix("rest" / "1.2") { path("users" / Segment / "proj

我是akka spray的新手:)

我有一个路由器演员:

class ProjectResource extends HttpServiceActor with DefaultJsonFormats  {
  import spray.http.MediaTypes.`application/json`

  def receive = runRoute {
    pathPrefix("rest" / "1.2") {
      path("users" / Segment / "projects" / Segment / "auth_url") { 
        case (key, id) =>
          get {
            respondWithMediaType(`application/json`) {
              requestContext =>
                val responder = context actorOf Responder.props(sender(), requestContext)
                context actorOf GetTask.props(key, id, responder)
            }
          }
      }
    }
  }
}
和响应者:

class Responder(replyTo: ActorRef, ctx: RequestContext) extends Actor with DefaultJsonFormats {
  implicit val authFormat = jsonFormat2(AuthDTO)

  def receive = {
    case x: AuthDTO =>
      ctx.complete(200, x)
      context stop self
  }
}
当我试图

旋度-v

我得到了这个错误(在ctx.complete(200,x)字符串上…):


我做错了什么?救命啊

我发现了这个问题——这是在case类中,如果其中一个字段为空,请添加您的注释作为答案,它帮助我找到了问题并解决了它;)
[ERROR] [07/11/2016 18:40:32.954] [default-akka.actor.default-dispatcher-3] [akka://default/user/projectResource] Error during processing of request HttpRequest(GET,http://localhost:8080/rest/1.2/users/123/projects/1/auth_url,List(User-Agent: curl/7.35.0, Host: localhost:8080),Empty,HTTP/1.1)
  java.lang.IllegalArgumentException: requirement failed