I am having this error when I am calling my custom flow through my RPCClient.
@PostMapping(value="/flows/issue")
private fun issuance(@RequestBody note : Money){
val matchingParties = proxy.partiesFromName(note.owner, false)
if(matchingParties.size != 1)
throw IllegalArgumentException("Enter a valid Party name")
val recipient = matchingParties.single()
proxy.startFlow(::IssueMoney, note.currency, note.amount, recipient)
}
My custom flow is another class with the classpath net.corda.server.flows . I have annotated it as @CordaSerializable and added the "-parameters" in the java compiler.
The error at the console at my node was
Serialization failed direction="Deserialize", type="java.lang.Class", msg="Could not instantiate net.corda.server.flows.IssueMoney - not on the classpath", corda ClassChain="java.util.List<*> -> net.corda.server.flows.IssueMoney"
The error at my webserver was
java.io.NotSerializableException: net.corda.server.flows.IssueMoney was not found by the node, check the Node containing the CorDapp that implements net.corda.server.flows.IssueMoney is loaded and on the Classpath