当我运行我的流程时,我得到以下错误。
java.lang.IllegalArgumentException: Step Requesting Stellar to execute the escrow. not found in progress tracker.
at net.corda.core.utilities.ProgressTracker.setCurrentStep(ProgressTracker.kt:140) ~[corda-core-4.3.jar:?]
at com.finablr.money.loyalty.wallet.flows.RevokeCustomToken.call(RevokeCustomToken.java:139) ~[wallet-workflows-0.1.jar:?]
at com.finablr.money.loyalty.wallet.flows.RevokeCustomToken.call(RevokeCustomToken.java:36) ~[wallet-workflows-0.1.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:270) ~[corda-node-4.3.jar:?]
at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:46) ~[corda-node-4.3.jar:?]
at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_222]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_222]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_222]
at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:63) ~[corda-node-4.3.jar:?]
即使我在流程中定义了该步骤。
private final Step STELLAR_EXECUTE_ESCROW = new Step("Requesting Stellar to execute the escrow.");
private final ProgressTracker progressTracker = new ProgressTracker(
STELLAR_EXECUTE_ESCROW
);
// Inside the call() method.
// Checkpoint workflow to replay from here in case of node failure.
sleep(Duration.ofMillis(1));
// Request Stellar to execute the escrow.
progressTracker.setCurrentStep(STELLAR_EXECUTE_ESCROW);
流程测试没有抛出该错误,它只发生在Google云上;不确定是否是检查点流程导致的。
你是说这个问题是google cloud特有的吗?你在本地运行时没有这个问题?
我想仔细检查一下你是如何定义进度跟踪器的。
下面是我手头的一个代码样本中关于进度跟踪器定义的要点。
public class YoFlow extends FlowLogic<SignedTransaction> {
private static final ProgressTracker.Step CREATING = new ProgressTracker.Step("Creating a new Yo!");
private static final ProgressTracker.Step SIGNING = new ProgressTracker.Step("Signing the Yo!");
private static final ProgressTracker.Step VERIFYING = new ProgressTracker.Step("Verfiying the Yo!");
private static final ProgressTracker.Step FINALISING = new ProgressTracker.Step("Sending the Yo!") {
@Nullable
@Override
public ProgressTracker childProgressTracker() {
return FinalityFlow.tracker();
}
};
ProgressTracker progressTracker = new ProgressTracker(
CREATING,
SIGNING,
VERIFYING,
FINALISING
);
@Nullable
@Override
public ProgressTracker getProgressTracker() {
return progressTracker;
}
private final Party target;
public YoFlow(Party target) {
this.target = target;
}
@Suspendable
@Override
public SignedTransaction call() throws FlowException {
progressTracker.setCurrentStep(CREATING);
另一种可能是,确保你覆盖了进度跟踪器的方法,如果你不这样做,那么由于一个不明显的corda bug,你不能通过SSH调用流。
请看 https:/docs.corda.netdocscorda-os4.4shell.html#limitations。
"除非覆盖进度跟踪器,否则无法运行流程"