我正在调用URLBuilder.build,它有这个调用跟踪:
servlet authv0的Servlet.service()抛出异常:
java.lang.NoSuchMethodError: org.apache.http.client.utils.URLEncodedUtils.format(Ljava/lang/Iterable;Ljava/nio/charset/Charset;)Ljava/lang/String;
at org.apache.http.client.utils.URIBuilder.encodeQuery(URIBuilder.java:176) [httpclient-4.2.5.jar:4.2.5]
at org.apache.http.client.utils.URIBuilder.buildString(URIBuilder.java:140) [httpclient-4.2.5.jar:4.2.5]
at org.apache.http.client.utils.URIBuilder.build(URIBuilder.java:103) [httpclient-4.2.5.jar:4.2.5]
我发现自4.2以来它一直存在,但它仍然给了我NoSuchMethodError
。如您所见,使用的jar版本是4.2.5。有人能指出我所缺少的东西吗?
这是我在4.2.5 jar中的清单文件
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: oleg
Build-Jdk: 1.5.0_22
Implementation-Build: tags/4.2.5/httpclient@r1469939; 2013-04-19 18:29
:05+0200
Implementation-Title: HttpComponents HttpClient
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 4.2.5
Specification-Title: HttpComponents HttpClient
Specification-Vendor: The Apache Software Foundation
Specification-Version: 4.2.5
X-Compile-Source-JDK: 1.5
X-Compile-Target-JDK: 1.5
url: http://hc.apache.org/httpcomponents-client