【发布时间】:2018-11-08 16:15:59
【问题描述】:
我定义了如下接口:
open class IsBustCommand(val bustParty: Party, val isBust: Boolean)
还有以下命令:
interface Commands : CommandData {
class GoToDirect(party: Party, isBust: Boolean) : IsBustCommand(party, isBust), Commands
}
当我运行流程时,它会抛出:
java.io.NotSerializableException: 构造函数参数 - “party” - 不引用“类”的属性 com.cordacodeclub.directAgreement.contract.DirectAgreementContract$Commands$GoToDirect" -> com.cordacodeclub.directAgreement.contract.DirectAgreementContract$Commands$GoToDirect 类 在 net.corda.nodeapi.internal.serialization.amqp.SchemaKt.fingerprintForType(Schema.kt:438) ~[corda-node-api-3.3-corda.jar:?] 在 net.corda.nodeapi.internal.serialization.amqp.SchemaKt.fingerprintForType$default(Schema.kt:352) ~[corda-node-api-3.3-corda.jar:?]
如果我将构造函数中的参数名称更改为:
class GoToDirect(bustParty: Party, isBust: Boolean) : IsBustCommand(bustParty, isBust), Commands```
然后我不再收到异常。这是怎么回事?
【问题讨论】:
标签: corda