找不到参数编组器的隐式值:spray.httpx.marshalling.ToResponseMarshaller[Unit]

could not find implicit value for parameter marshaller: spray.httpx.marshalling.ToResponseMarshaller[Unit]

我要执行以下代码:

import akka.actor.ActorSystem
import spray.routing.SimpleRoutingApp
import spray.json.DefaultJsonProtocol._
object Server1 extends App with SimpleRoutingApp{
def testing(p:String,q:String){
println(p+"  "+q)
}
implicit val actorSystem = ActorSystem()        
var state:String=""
startServer(interface="localhost",port = 8080){
println("Listening...")         
    get{
        println("incoming..")
        path("state"){
            parameters("alertC".as[String],"alertB".as[String]){   (alertC,alertB)=>{

                    complete{
                        testing(alertC,alertB)
                    }


                }   
            }
        } 
    }
}

}

编译时的错误是: 找不到参数编组器的隐式值:spray.httpx.marshalling.ToResponseMarshaller[Unit] 错误:测试(alertC,alertB)

Spray 找不到 Unit 的编组器。 Return 来自 testing 的字符串,例如。