我正在使用 Recurly 客户端 maven 依赖项,并且我在 recurlyclient.java 中遇到错误
错误表明
"java.lang.NoSuchMethodError: com.ning.http.client.AsyncHttpClientConfig$Builder.setMaximumConnectionsPerHost(I)Lcom/ning/http/client/AsyncHttpClientConfig$Builder"
这是关于 recurlyClient.open()
请帮我解决这个问题
最佳答案
这很可能是 async-http-client
库的版本不匹配。
运行时可用的 async-http-client
版本是什么? v1.8.0 中的 setMaximumConnectionsPerHost(int)
方法(以及之前的版本)在 v1.9.0 中重命名为 setMaxConnectionsPerHost(int)
.
因此,您的代码或您使用的某些库的特定版本经过编码,可以与 v1.8.0
或更少的 async-http-client
一起使用,但在运行时您可以使用它的v1.9.0
。查看您的 Maven 依赖关系树来解决问题。
关于java - 重复验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31879729/