简体   繁体   English

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

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

i have following code to execute: 我有以下代码要执行:

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


                }   
            }
        } 
    }
}

} }

at complie time the error is: could not find implicit value for parameter marshaller: spray.httpx.marshalling.ToResponseMarshaller[Unit] error at: testing(alertC,alertB) 在编译时错误为:找不到参数marshaller的隐式值:spray.httpx.marshalling.ToResponseMarshaller [Unit]错误于:testing(alertC,alertB)

Spray cannot find a marshaller for Unit . Spray找不到Unit的编组。 Return a string from testing , for example. 例如,返回来自testing的字符串。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误无法将值隐含到ToResponseMarshaller [SearchResponse] - Error Could Not Implicit Value ToResponseMarshaller[SearchResponse] spray-json递归json问题-找不到证据参数的隐式值 - spray-json recursive json issue - could not find implicit value for evidence parameter spray-json:找不到FromRequestUnmarshallar的隐式值 - spray-json: could not find implicit value for FromRequestUnmarshallar Flink - 导入类型不能修复“无法找到类型…TypeInformation 的证据参数的隐式值” - Flink - importing types doesn't fix “could not find implicit value for evidence parameter of type …TypeInformation” 喷涂:将UUID编组为JSON - Spray: Marshalling UUID to JSON 找不到io.circe.generic.decoding.DerivedDecoder类型的Lazy隐式值[Staff] - could not find Lazy implicit value of type io.circe.generic.decoding.DerivedDecoder[Staff] Circe DeriveDecoder/deriveEncoder 找不到 io.circe.generic.encoding.DerivedAsObjectEncoder 类型的惰性隐式值 - Circe deriveDecoder/deriveEncoder could not find Lazy implicit value of type io.circe.generic.encoding.DerivedAsObjectEncoder spray-json-发散的隐式扩展 - spray-json - diverging implicit expansion Circe无法将原始json转换为case类错误:找不到类型为io.circe.generic.decoding.DerivedDecoder的Lazy隐含值 - Circe Couldn't convert raw json to case class Error: could not find Lazy implicit value of type io.circe.generic.decoding.DerivedDecoder 如何为spray + akka actor设置隐式json转换 - How to setup implicit json convertion for spray+akka actor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM