Skip to content

ledger transfers fail with non-specific exceptions on alpha

Given an account that holds tokens of a certain type, issued by different notaries, the transfer fails if there insufficient funds allocated to the notary that is being used for the transfer.

This is the stack trace:


java.util.NoSuchElementException: Collection is empty.
	at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:166) ~[kotlin-stdlib-1.1.60.jar:1.1.60-release-55 (1.1.60)]
	at io.cordite.dgl.corda.token.flows.TransferTokenSenderFunctions$Companion.computeOutputs(TransferTokenUtilities.kt:91) ~[dgl-cordapp-0.0.1.jar:?]
	at io.cordite.dgl.corda.token.flows.TransferTokenSenderFunctions$Companion.prepareTokenMove(TransferTokenUtilities.kt:58) ~[dgl-cordapp-0.0.1.jar:?]
	at io.cordite.dgl.corda.token.flows.TransferTokenFlow.call(TransferTokenFlow.kt:28) ~[dgl-cordapp-0.0.1.jar:?]
	at io.cordite.dgl.corda.token.flows.TransferTokenFlow.call(TransferTokenFlow.kt:17) ~[dgl-cordapp-0.0.1.jar:?]
	at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:96) [corda-node-corda-3.0.jar:?]
	at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:44) [corda-node-corda-3.0.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_163]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_163]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_163]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_163]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_163]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_163]
	at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:62) [corda-node-corda-3.0.jar:?]

This needs to be resolved two-fold:

  1. report something more meaningful than: java.util.NoSuchElementException: Collection is empty.
  2. implement implicit notary transfers to keep the dgl api simple
Edited by Fuzz
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information