nikhilsarika
nikhilsarika

Reputation: 39

NoSuchMethodError Exception in Corda Project

In our Corda project We are using FlowExternalAsyncOperation to interact with an external service. The flows are able to interact with external service when invoked via Corda node cli. We have implemented a standalone rpc client to invoke the flows. We are getting the below error when trying to start the nodes via rpc connection. Below is the stack trace of the error

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
    at net.corda.client.rpc.internal.RPCClientProxyHandler.createRpcObservableMap(RPCClientProxyHandler.kt:205)
    at net.corda.client.rpc.internal.RPCClientProxyHandler.<init>(RPCClientProxyHandler.kt:168)
    at net.corda.client.rpc.internal.RPCClientProxyHandler.<init>(RPCClientProxyHandler.kt:108)
    at net.corda.client.rpc.internal.RPCClient$start$1.invoke(RPCClient.kt:90)
    at net.corda.client.rpc.internal.RPCClient$start$1.invoke(RPCClient.kt:32)
    at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:224)
    at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:214)
    at net.corda.client.rpc.internal.RPCClient.start(RPCClient.kt:72)
    at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt:620)
    at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt:575)
    at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt:529)
    at net.corda.client.rpc.CordaRPCClient.start$default(CordaRPCClient.kt:527)
    at net.corda.client.rpc.CordaRPCClient.start(CordaRPCClient.kt)

Upvotes: 0

Views: 78

Answers (1)

Ashutosh Meher
Ashutosh Meher

Reputation: 1831

Putting the solution in the answer. The issue comes mostly due to version mismatch in the dependencies. This case perhaps has two different versions of the same library. One of them can be excluded using gradle.

Example:

compile('org.springframework.boot:spring-boot-starter-web') {    
    exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}

Upvotes: 1

Related Questions