英文:
NoSuchMethodError Exception in Corda Project
问题
以下是翻译好的部分:
在我们的 Corda 项目中,我们正在使用 FlowExternalAsyncOperation 与外部服务进行交互。当通过 Corda 节点命令行调用这些流程时,它们能够与外部服务交互。我们已经实现了一个独立的 RPC 客户端来调用这些流程。然而,在尝试通过 RPC 连接启动节点时,我们遇到了以下错误。以下是错误的堆栈跟踪:
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)
请注意,我只翻译了你提供的文本内容,代码部分保持原样。如果有其他需要翻译的内容,请继续提供。
英文:
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)
答案1
得分: 1
将解决方案放入答案中。
问题主要是由依赖项版本不匹配引起的。这种情况下可能存在同一库的两个不同版本。可以使用gradle来排除其中一个版本。
示例:
compile('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}
英文:
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'
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论