Pe4eN
Pe4eN

Reputation: 44

Cannot find contract attachments

I tried to launch my Cordapp from IDE. When I make request I get following error:

net.corda.core.transactions.MissingContractAttachments: Cannot find contract attachments for [com.example.contract.IBuildContract].

I read about this problem here: https://docs.corda.net/api-contract-constraints.html#debugging

But IDE can find setExtraCordappPackagesToScan. How I can set extra packages or save this problem in other way in corda v3?

Upvotes: 2

Views: 1079

Answers (2)

manish
manish

Reputation: 331

Do not add the Contract name .I mean just include till the package .

withExtraCordappPackagesToScan(Arrays.asList("com.example.contract")

In java , we are including the package as below :

@Before public void setup() { network = new MockNetwork(ImmutableList.of("com.xyz.module1.contract","com.xyz.module2.contract"));

Upvotes: 1

Joel
Joel

Reputation: 23140

If you're using the node driver to start your nodes, here's an example of setting the extra CorDapp packages to scan:

driver(DriverParameters(
    isDebug = true, 
    extraCordappPackagesToScan = listOf("net.corda.vega.contracts", "net.corda.vega.plugin.customserializers"))
) {
    TODO("Driver logic.")
}

Upvotes: 0

Related Questions