title: connect failed: ECONNREFUSED
body: <p>I am developing one app, and what I think I wanna do is receive data from server database in android. So I started to run some tutorials. I found one that is doing pretty much what I want. 
  But I am getting: </p>
  
  <pre><code>detailMessage   "failed to connect to localhost/127.0.0.1 (port 8080): connect failed: ECONNREFUSED (Connection refused)" (id=830021648792) 
  </code></pre>
  
  <p>Whole code of this tutorial is here <a href="http://veereshr.com/Android/AndroidToServlet" rel="noreferrer">link</a></p>
  
  <p>Error occurs on : </p>
  
  <p><code>OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());</code></p>
  
  <p>I checked that:</p>
  
  <ul>
  <li>firewall is disabled</li>
  <li>ping is working</li>
  <li>connection string is exactly the same as when I run the servlet from server admin interface - <code>http://localhost:8080/Requestor/RQSRV</code>
  -the servlet is running </li>
  </ul>
  
  <p>My configuration :</p>
  
  <ul>
  <li>Server : Glass Fish 4.0</li>
  <li>Android App - Developed in Eclipse</li>
  <li>Servlet - Developed in NetBeans</li>
  </ul>