Note that there are some explanatory texts on larger screens.

plurals
  1. POhttpResponse/httppost Connection Refused Warning and then error due to it
    primarykey
    data
    text
    <p>I am getting this warning :</p> <pre><code> 06-26 15:19:09.689: W/System.err(611): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8080 refused 06-26 15:19:09.689: W/System.err(611): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183) 06-26 15:19:09.719: W/System.err(611): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 06-26 15:19:09.719: W/System.err(611): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 06-26 15:19:09.719: W/System.err(611): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360) 06-26 15:19:09.739: W/System.err(611): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 06-26 15:19:09.739: W/System.err(611): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 06-26 15:19:09.739: W/System.err(611): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) </code></pre> <p>while trying to excute this code in a non-ui class :</p> <pre><code>1 public String getXmlFromUrl(String url) { 2 String xml = null; 3 try { 4 HttpClient httpClient = new DefaultHttpClient(); 5 HttpPost httpPost = new HttpPost(url); 6 HttpResponse httpResponse = httpClient.execute(httpPost); 7 HttpEntity httpEntity = httpResponse.getEntity(); 8 xml = EntityUtils.toString(httpEntity); 9 } catch (UnsupportedEncodingException e) { 10 e.printStackTrace(); 11 } catch (ClientProtocolException e) { 12 e.printStackTrace(); 13 } catch (IOException e) { 14 e.printStackTrace(); 15 } 16 return xml; 17 } </code></pre> <p>i am supplying url as </p> <pre><code>http://10.0.2.2:8080/Mysite/xxx </code></pre> <p>What is the problem here.Why am i getting this error.</p> <p>because of this the "xml" string is returned null which further leads to error in my app.</p> <p>I debugged my app and i can see that i catch an exception IOException and because of this i am going from line 6 to line 13.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload