java.lang.NoSuchMethodError:org.apache.commons.codec.binary.Base64。<init>(I)V

时间:2017-01-19 17:34:49

标签: java spring httpclient resttemplate apache-commons-httpclient

在调用spring RestTemplate的execute方法时,我收到了以下异常:

java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.<init>(I)V
at org.apache.http.impl.auth.GGSSchemeBase.<init>(GGSSchemeBase.java:79)
at org.apache.http.impl.auth.SPNegoScheme.<init>(SPNegoScheme.java:51)
at org.apache.http.impl.auth.SPNegoSchemeFactory.newInstance(SPNegoSchemeFactory.java:62)
at org.apache.http.auth.AuthSchemeRegistry.getAuthScheme(AuthSchemeRegistry.java:113)
at org.apache.http.auth.AuthSchemeRegistry$1.create(AuthSchemeRegistry.java:149)
at org.apache.http.impl.client.AuthenticationStrategyImpl.select(AuthenticationStrategyImpl.java:175)
at org.apache.http.impl.client.TargetAuthenticationStrategy.select(TargetAuthenticationStrategy.java:43)
at org.apache.http.impl.auth.HttpAuthenticator.handleAuthChallenge(HttpAuthenticator.java:154)
at org.apache.http.impl.client.HttpAuthenticator.authenticate(HttpAuthenticator.java:58)
at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1057)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:515)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:91)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:596)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557)
at TemplateTest.execute(TemplateTest.java:53)

我认为这是由于罐子中的一些不匹配造成的。我猜GGSSchemBase需要不同版本的Base64类(比较旧,更新?)。我不确定如何协调它看到的东西和它需要的东西。有任何想法吗?感谢

0 个答案:

没有答案