索引0 {}缺少参数名称 [英] missing parameter name at index 0 {}

查看:113
本文介绍了索引0 {}缺少参数名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试编写一个演示-基于 deliverydemo : //github.com/corda/bootcamp-cordapp rel = nofollow noreferrer> bootcamp-cordapp 并引用 cordapp示例
在方AC和公证人通过命令 build / nodes / runnodes启动后:

I try to write a demo - deliverydemo base on bootcamp-cordapp and refer cordapp-example for my own Order Flow. After Party A-C and Notary started by command "build/nodes/runnodes":


  1. TokenIssueFlow已工作。

  2. 我可以在CLI中通过流列表命令查看我的订单流。
    尝试启动我的订单流程时出现索引0 {}缺少参数名称的情况。








Chu 2018年7月26日09:41:51 >>>流程开始
OrderPlaceFlow $ OrderPlaceRequestFlow买方:PartyB,卖方:PartyC,
sellingPrice :12.9,downPayments:0.1流程开始
OrderPlaceFlow $ OrderPlaceRequestFlow买方:PartyB,卖方:PartyC,
sellingPrice:12.9,downPayments:0.1:异常:无法解析为
命令:方法lambda $ call $ 6索引0处缺少参数名称Thu
Jul 26 09:41:55 CST 2018 >>> E 09:41:55 + 0800 [pool-8-thread-8]
command.CRaSHSession .execute-评估请求'流程
开始OrderPlaceFlow $ OrderPlaceRequestFlow买方时发生错误:PartyB,卖方:
PartyC,卖方价格:12.9,首付款:0.1'流程开始
OrderPlaceFlow $ OrderPlaceRequestFlow买方:PartyB,卖方:PartyC,
卖出价格:12.9,向下付款:0.1:例外:无法解析为
逗号nd:方法lambda $ call $ 6缺少索引0处的参数名{}
net.corda.client.jackson.StringToMethodCallParser $ UnparseableCallException $ ReflectionDataMissing:
无法解析为命令:方法lambda $ call $ 6丢失参数

处索引0处的名称net.corda.client.jackson.StringToMethodCallParser.paramNamesFromMethod(StringToMethodCallParser.kt:131)
〜[corda-jackson-corda-3.0.jar :?]

Thu Jul 26 09:41:51 CST 2018>>> flow start OrderPlaceFlow$OrderPlaceRequestFlow buyer: PartyB, seller: PartyC, sellingPrice: 12.9, downPayments: 0.1 flow start OrderPlaceFlow$OrderPlaceRequestFlow buyer: PartyB, seller: PartyC, sellingPrice: 12.9, downPayments: 0.1: exception: Could not parse as a command: Method lambda$call$6 missing parameter name at index 0 Thu Jul 26 09:41:55 CST 2018>>> E 09:41:55+0800 [pool-8-thread-8] command.CRaSHSession.execute - Error while evaluating request 'flow start OrderPlaceFlow$OrderPlaceRequestFlow buyer: PartyB, seller: PartyC, sellingPrice: 12.9, downPayments: 0.1' flow start OrderPlaceFlow$OrderPlaceRequestFlow buyer: PartyB, seller: PartyC, sellingPrice: 12.9, downPayments: 0.1: exception: Could not parse as a command: Method lambda$call$6 missing parameter name at index 0 {} net.corda.client.jackson.StringToMethodCallParser$UnparseableCallException$ReflectionDataMissing: Could not parse as a command: Method lambda$call$6 missing parameter name at index 0 at net.corda.client.jackson.StringToMethodCallParser.paramNamesFromMethod(StringToMethodCallParser.kt:131) ~[corda-jackson-corda-3.0.jar:?]








CST Jul 26 09:38:32 CST 2018 >>>流程列表
com.cienet.deliverydemo.order.OrderPlaceFlow $ OrderPlaceRequestFlow
com.cienet.deliverydemo.token.TokenIssueFlow
net.corda.core.flows.ContractUpgradeFlow $ Authorise
net.corda.core.flows.ContractUpgradeFlow $ Deauthorise
net.corda.core.flows.ContractUpgradeFlow $ Initiate

Thu Jul 26 09:38:32 CST 2018>>> flow list com.cienet.deliverydemo.order.OrderPlaceFlow$OrderPlaceRequestFlow com.cienet.deliverydemo.token.TokenIssueFlow net.corda.core.flows.ContractUpgradeFlow$Authorise net.corda.core.flows.ContractUpgradeFlow$Deauthorise net.corda.core.flows.ContractUpgradeFlow$Initiate

Thu Jul 26 09:38 :34 CST 2018 >>>

Thu Jul 26 09:38:34 CST 2018>>>







public OrderPlaceRequestFlow(Party buyer, Party seller, float sellingPrice, float downPayments) {
    this.buyer = buyer;
    this.seller = seller;
    this.sellingPrice = sellingPrice;
    this.downPayments = downPayments;
}


推荐答案

有时, -构建问题。
但是,如果您将JAVA用于流,并使用会话发送/接收/取消扭曲,则将出现此错误。

Sometimes, that is a re-build issue. But, if you are using JAVA for a flow, and using session send/receive/unwarp, this error will rise. And not happen in Kotlin code.

编辑:

我添加了Kotlin代码仅用于发送/接收StateAndRef。

I add a Kotlin code just for sending/receiving StateAndRef.

class TokenAsk(private val otherPartyFlow: FlowSession) {

@Suspendable
fun askTokenState(amount: Int, owner: Party): StateAndRef<TokenState> {
    otherPartyFlow.send(amount)
    otherPartyFlow.send(owner)
    return otherPartyFlow.receive<StateAndRef<TokenState>>().unwrap { it }
}

@Suspendable
fun receiveAmount(): Int =
    otherPartyFlow.receive<Int>().unwrap{it}

@Suspendable
fun receiveOwner(): Party =
        otherPartyFlow.receive<Party>().unwrap{it}

@Suspendable
fun sendStateAndRef(tokenStateAndRef: StateAndRef<TokenState>) =
    otherPartyFlow.send(tokenStateAndRef)

}

**编辑2 **

当我使用Kotlin代码时,我再次遇到此错误。
为了避免此错误,我必须在Flow的构造函数中删除私有关键字。

I faced this error again, when I am using Kotlin code. I have to remove the "private" key word in the constructor of a Flow for avoiding this error.

发件人:

class Initiator(private val number: String, private val otherParty: Party) : FlowLogic<SignedTransaction>()

收件人:

class Initiator(val number: String, val otherParty: Party) : FlowLogic<SignedTransaction>()

这篇关于索引0 {}缺少参数名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆