Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7862019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:58:06+00:00 2026-06-02T22:58:06+00:00

I’m trying to implement a REST communication on Android with the Apache HttpAsyncClient (version

  • 0

I’m trying to implement a REST communication on Android with the Apache HttpAsyncClient (version 4.0-beta1, which is the newest at the time of writing this post).

My problem is, that I cannot get any request out, because of a MethodNotFound error which comes from WITHIN the framework.

The detailed stacktrace is (after the presented rows, the next one comes from my own code):

java.lang.NoSuchMethodError: org.apache.http.client.utils.URIUtils.extractHost
    at org.apache.http.impl.nio.client.AbstractHttpAsyncClient.determineTarget(AbstractHttpAsyncClient.java:594)
    at org.apache.http.impl.nio.client.AbstractHttpAsyncClient.execute(AbstractHttpAsyncClient.java:578)
    at org.apache.http.impl.nio.client.AbstractHttpAsyncClient.execute(AbstractHttpAsyncClient.java:569)

What I did is the following:

private static final String SERVER_SCHEME = "http";
private static final String SERVER_HOST = "localhost";
private static final int SERVER_PORT = 3000;
private static final String SERVER_BASE_PATH = "/api/v1";
private static final String PATH_LOGIN = "/login";

private DefaultHttpAsyncClient http_client;

public void test(String email, String password, ConnectionManagerCallback callback) {
    this.http_client = new DefaultHttpAsyncClient();
    this.http_client.start();

    this.http_client.getCredentialsProvider().setCredentials(new AuthScope(SERVER_HOST, SERVER_PORT), new UsernamePasswordCredentials(email, password));
    HttpPost request = new HttpPost(SERVER_SCHEME + "://" + SERVER_HOST + ":" + SERVER_PORT + SERVER_BASE_PATH + PATH_LOGIN);

    this.http_client.execute(request, new Callback(REQUEST_LOGIN, callback));
}

I have removed the Exception Handling for the sake of the example. The problem is, that I get the exception I described above. So since it’s a beta version I thought of using a different constructor for the HttpPost. But even when I give an URI Object to the constructur it tries to call the extractHost method and crashes.

Does anyone have any help for me on this one? I just added the JARs by the way and did not compile the library myself.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:58:08+00:00Added an answer on June 2, 2026 at 10:58 pm

    Apache HttpAsyncClient is based on a low level HTTP transport library called HttpCore. Google Android ships with an extremely outdated version of Apache HttpClient which is also based on the same library. HttpAsyncClient requires a newer version of HttpCore that the one shipped with Android. However, classes from the older version get picked up by the classloader first causing NoSuchMethodError exception whenever an attempt is made to call a method from the newer version.

    Unfortunately there the only solution to this problem is moving all HttpAsyncClient code and its dependencies to a different name space.

    Update Nov 2020

    Upgrade to Apache HttpClient 5.x

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.