tags:

views:

15

answers:

1

I have a basic Jetty server running locally. If I pull up http://localhost/servlet1 in a web browser on my desktop, I am able to see proper content (basic html page). However, when I navigate to this site in the Android Emulator (2.2), I get the following error:

Request Error (invalid_request) Your request could not be processed.

Request could not be handled This could be caused by a misconfiguration, or possibly a malformed request.

For assistance, contact your network support team.

Any idea what the issue might be? I'm afraid to move on if this basic task doesn't work.

+1  A: 

Due to the nature of the network stack in the emulator, you can't use "localhost" or 127.0.0.1 to connect to the host computer. Try using 10.0.2.2 instead, so: http://10.0.2.2/servlet1

From http://code.google.com/p/android/issues/detail?id=133:

127.0.0.1 is the emulated system's own loopback interface, not the one running on your host development machine.

within the Android system, one should use 10.0.2.2 which is an alias specifically setup to contact your host 127.0.0.1

Marc Novakowski