首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Corda显式合同升级NoSuchElementException: List为空

Corda显式合同升级NoSuchElementException: List为空
EN

Stack Overflow用户
提问于 2019-05-23 16:54:38
回答 1查看 289关注 0票数 0

我想升级科达的合同。目前,我们有一个具有状态、流和契约的uber jar。我们使用显式升级机制,使用UpgradeContractUsingLegacyConstraint接口在单独的jars中分解uber jars。

在我们的网络中,有一个观测器节点,它跟踪网络中其他节点之间发生的所有事务。因此,在这个场景中,我们在网络中的所有节点中运行授权流,然后在观察者节点中运行启动流。虽然“授权流”在所有节点中运行成功,没有任何错误,但“启动流”有两个问题。

  1. 其中一些流动正在失败。我们得到了错误的多个NoSuchElementException实例。堆栈跟踪如下所示
  2. 其中一些流动仍在等待中。在Jolokia的监测中,我们得到了类似的统计数据,其中一些仍处于飞行状态.在Corda shell中,在运行flow watch命令之后,我们得到了待定交易。我们试图重新启动系统,但问题仍然存在于观察者节点中。

下一步或推荐的升级合同的方法应该是什么?我正在使用Ubuntu16.04上的Cordav3.3,Cordite网络图,并参考github存储库来升级合同( https://github.com/amolpednekar/contract-state-upgrades/blob/master/cordapp/src/main/kotlin/com/upgrade/Client.kt )。

堆栈跟踪:

代码语言:javascript
复制
[WARN ] 2019-05-22T22:16:31,568Z [Node thread-1] flow.[fa8a213f-8de7-4cd8-8d41-8493bbc9cecf].run - Terminated by unexpected exception {}
java.util.NoSuchElementException: List is empty.
    at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:472) ~[kotlin-stdlib-1.1.60.jar:1.1.60-release-55 (1.1.60)]
    at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:454) ~[kotlin-stdlib-1.1.60.jar:1.1.60-release-55 (1.1.60)]
    at net.corda.core.flows.ContractUpgradeFlow$Initiate.assembleTx(ContractUpgradeFlow.kt:77) ~[corda-core-3.3-corda.jar:?]
    at net.corda.core.flows.AbstractStateReplacementFlow$Instigator.call(AbstractStateReplacementFlow.kt:64) ~[corda-core-3.3-corda.jar:?]
    at net.corda.core.flows.AbstractStateReplacementFlow$Instigator.call(AbstractStateReplacementFlow.kt:50) ~[corda-core-3.3-corda.jar:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96) [corda-node-3.3-corda.jar:?]
    at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44) [corda-node-3.3-corda.jar:?]
    at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.9-jdk8.jar:0.7.9]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
    at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62) [corda-node-3.3-corda.jar:?]
[WARN ] 2019-05-22T22:16:31,574Z [Node thread-1] flow.[5856148a-d233-43c4-ac20-396b9a91f6c0].run - Terminated by unexpected exception {}

编辑:捕获的其他一些错误:

代码语言:javascript
复制
[WARN ] 2019-06-03T16:36:22,357Z [Node thread-1] flow.[2aec6ee2-2e14-43f5-81ce-b301c4876e0a].run - Terminated by unexpected exception {}
java.lang.ClassCastException: io.corp.contract.DefaultContract cannot be cast to net.corda.core.contracts.UpgradedContract
        at net.corda.core.flows.ContractUpgradeFlow$Authorise.call(ContractUpgradeFlow.kt:38) ~[corda-core-3.3-corda.jar:?]
        at net.corda.core.flows.ContractUpgradeFlow$Authorise.call(ContractUpgradeFlow.kt:31) ~[corda-core-3.3-corda.jar:?]
        at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96) [corda-node-3.3-corda.jar:?]
        at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44) [corda-node-3.3-corda.jar:?]
        at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) [quasar-core-0.7.9-jdk8.jar:0.7.9]
        at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) [quasar-core-0.7.9-jdk8.jar:0.7.9]
        at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) [quasar-core-0.7.9-jdk8.jar:0.7.9]
        at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) [quasar-core-0.7.9-jdk8.jar:0.7.9]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
        at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62) [corda-node-3.3-corda.jar:?]

此外,这也是我们的合同升级发现。

代码语言:javascript
复制
[WARN ] 2019-06-03T17:44:26,859Z [Messaging DLJKqkjV9pKTqG5nKbQQ3o5B1hPj1zjrYxDYpbhPENXdR] messaging.P2PMessagingClient.sendWithRetry - Reached the maximum number of retries (3) for message ClientMessageImpl[messageID=0, durable=true, address=internal.peers.DL8itTRrD1LvKjd5sQ9DwX59KmZ42PTa964nJPfL6jf1VC,userID=null,properties=TypedProperties[platform-version=3,corda-vendor=Corda Open Source,release-version=3.3-corda,platform-topic=platform.session,_AMQ_DUPL_ID=23190134-6514-4165-8277-0e3df48e2678,corda_p2p_message_type=session_init]] redelivery to internal.peers.DL8itTRrD1LvKjd5sQ9DwX59KmZ42PTa964nJPfL6jf1VC {}
[WARN ] 2019-06-03T17:44:26,941Z [Messaging DLJKqkjV9pKTqG5nKbQQ3o5B1hPj1zjrYxDYpbhPENXdR] messaging.P2PMessagingClient.sendWithRetry - Reached the maximum number of retries (3) for message ClientMessageImpl[messageID=0, durable=true, address=internal.peers.DL8itTRrD1LvKjd5sQ9DwX59KmZ42PTa964nJPfL6jf1VC,userID=null,properties=TypedProperties[platform-version=3,corda-vendor=Corda Open Source,release-version=3.3-corda,platform-topic=platform.session,_AMQ_DUPL_ID=2e2cde97-1e3d-4ce9-b7af-01ab61a88114,corda_p2p_message_type=session_init]] redelivery to internal.peers.DL8itTRrD1LvKjd5sQ9DwX59KmZ42PTa964nJPfL6jf1VC {}
EN

回答 1

Stack Overflow用户

发布于 2019-05-30 15:22:42

从堆栈跟踪来看,发起者似乎不是原始状态的参与者。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56279843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档