We're updating the issue view to help you get more done. 

Auto attachment of dependencies fails to find class

Description

The code responsible for attachment of dependencies to transactions fails to find class although it is in a jar in cordapps. The exception:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [INFO ] 2019-04-16T08:45:43,116Z [Node thread-1] statemachine.StaffedFlowHospital.invoke - Error 1 of 1: {actor_id=internalShell, actor_owning_identity=O=Exchange, L=Zurich, C=CH, actor_store_id=NODE_CONFIG, fiber-id=10000004, flow-id=f8e4adb9-2795-4cb6-adcb-692d86650112, invocation_id=876ea9ab-526c-4ed0-87d9-c9778650544f, invocation_timestamp=2019-04-16T08:45:41.959Z, origin=internalShell, session_id=d411c850-cae8-4c46-b2f5-3dd5de624bdb, session_timestamp=2019-04-16T06:56:18.238Z, thread-id=314} java.lang.IllegalArgumentException: The transaction currently built is missing an attachment for class: net/corda/core/contracts/TransactionState (erased) -> data(net/corda/core/contracts/ContractState) -> com/r3/corda/sdk/token/contracts/states/FungibleToken (erased) -> amount(net/corda/core/contracts/Amount<com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType>>) -> net/corda/core/contracts/Amount<com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType>> -> token(com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType>) -> com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType> -> tokenType(com/r3/corda/sdk/token/contracts/types/TokenType) -> com/r3/corda/sdk/token/money/FiatCurrency. Attempted to find a suitable attachment but could not find any in the storage. Please contact the developer of the CorDapp for further instructions. at net.corda.core.transactions.TransactionBuilder.addMissingAttachment(TransactionBuilder.kt:203) ~[corda-core-4.1-RC01.jar:?] at net.corda.core.transactions.TransactionBuilder.addMissingDependency(TransactionBuilder.kt:187) ~[corda-core-4.1-RC01.jar:?] at net.corda.core.transactions.TransactionBuilder.toWireTransactionWithContext$core(TransactionBuilder.kt:159) ~[corda-core-4.1-RC01.jar:?] at net.corda.core.transactions.TransactionBuilder.toWireTransactionWithContext$core$default(TransactionBuilder.kt:127) ~[corda-core-4.1-RC01.jar:?] at net.corda.core.transactions.TransactionBuilder.toWireTransaction(TransactionBuilder.kt:124) ~[corda-core-4.1-RC01.jar:?] at net.corda.core.transactions.TransactionBuilder.toLedgerTransaction(TransactionBuilder.kt:469) ~[corda-core-4.1-RC01.jar:?] at net.corda.core.transactions.TransactionBuilder.verify(TransactionBuilder.kt:477) ~[corda-core-4.1-RC01.jar:?] at com.sdx.settler.workflows.flows.AbstractSettlementInitiator.call(Settlement.kt:70) ~[?:?] at com.sdx.settler.workflows.flows.AbstractSettlementInitiator.call(Settlement.kt:43) ~[?:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:299) ~[corda-node-4.1-RC01.jar:?] at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:314) ~[corda-core-4.1-RC01.jar:?] at com.sdx.settler.workflows.flows.WireSettlementBatchInitiator.call(Settlement.kt:206) ~[?:?] at com.sdx.settler.workflows.flows.WireSettlementBatchInitiator.call(Settlement.kt:202) ~[?:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:239) ~[corda-node-4.1-RC01.jar:?] at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:45) ~[corda-node-4.1-RC01.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(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_202] at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:63) ~[corda-node-4.1-RC01.jar:?]

The investigation shows the following:

"the code is expecting that the class missing is "e.message", which according to this printout is et/corda/core/contracts/TransactionState (erased) -> data(net/corda/core/contracts/ContractState) -> com/r3/corda/sdk/token/contracts/states/FungibleToken (erased) -> amount(net/corda/core/contracts/Amount<com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType>>) -> net/corda/core/contracts/Amount<com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType>> -> token(com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType>) -> com/r3/corda/sdk/token/contracts/types/IssuedTokenType<com/r3/corda/sdk/token/contracts/types/TokenType> -> tokenType(com/r3/corda/sdk/token/contracts/types/TokenType) -> com/r3/corda/sdk/token/money/FiatCurrency.
which of course is class one can't find
line 202 in TransactionBuilder"

Status

Assignee

Tudor Malene

Reporter

Alex Koller

Priority

Medium

Labels

None

Severity

Medium

Fix versions

Ported to...

None

Feature Team

Corda Core

Sprint

None

Affects versions

Corda 4.1