1
votes

I'm trying to test my Cordapp (using Corda 4, gradle) with a Spring-boot webserver by creating a transaction, but am running into an error stating my.app.ContractState is not found by the node.

I have three modules: contracts (holds contracts and states), workflows, and spring. I've made sure to include workflows and contracts as cordapp project depencencies in my build.gradle for spring. All states contain @CordaSerializable.

"java.io.NotSerializableException: my.app.state.contractState was not found by the node, check the Node containing the CorDapp that implements my.app.state.contractState is loaded and on the Classpath"

Expected results include status 200 as well as a summary of the transaction that was committed to the ledger.

I receive this error when I make local http calls (ex. http://localhost:8088/create-txn) that should create a new transaction, but have not been able to remedy this issue yet. Has any one else come across this issue?

2

2 Answers

0
votes

Is your contract.jar contain net.corda.core.serialization.SerializationWhitelist file under path META-INF\services\ ?. Because I used to have this error but after remove Whitelist file in contract it's work fine. I think net.corda.core.serialization.SerializationWhitelist should contain in flow.jar only.

0
votes

I was able to fix the issue. I needed the the contracts module to be set as default Cordapp project in the deployNodes task.