java.lang.nosuchmethoderror : org.apache.http.protocol.basichttpcontext : method () v 찾을 수 없음

StackOverflow https://stackoverflow.com/questions/1617042

  •  06-07-2019
  •  | 
  •  

문제

안녕하세요 저는 작은 웹 앱을 올리려고하지만 오류 이상을 얻고 있습니다. 아래는 내 코드입니다

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("SomeURL"); // Using a URL local to my machine
// after setting nameValuePair and setting it on httppost
httppost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

// This is where I am getting the above mentioned exception
HttpResponse response = httpclient.execute(httppost);

나는 httpclient-4.0-beta2.jar 및 httpcore-4.0.1.jar를 사용하고 있습니다. BasichttpContext가 내 앱에서 다른 항아리와 충돌하는 것처럼 보이지만 알아낼 수 없었습니다. 모든 단서는 감사하겠습니다.

도움이 되었습니까?

해결책

이전/새 버전의 항아리 파일이있는 것 같습니다. BasicHttpContext. 직접적인 갈등이 있으면 ClassNotFoundException. 클래스 로더는 일반적으로 이런 종류의 일에 대해 바보입니다. 이 경우 클래스는 존재하지만 다른 라이브러리가없는 방법이 없습니다 (나는 Httpclient가 Context)는 편집되었습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top