title: java.net.SocketException: Software caused connection abort: recv failed
body: <p>I haven't been able to find an adequate answer to what exactly the following error means:</p>
  
  <p><code>java.net.SocketException: Software caused connection abort: recv failed</code> </p>
  
  <p>Notes:</p>
  
  <ul>
  <li>This error is infrequent and unpredictable; although getting this error means that all future requests for URIs will also fail.</li>
  <li>The only solution that works (also, only occasionally) is to reboot Tomcat and/or the actual machine (Windows in this case).</li>
  <li>The URI is definitely available (as confirmed by asking the browser to do the fetch).</li>
  </ul>
  
  <p>Relevant code:</p>
  
  <pre><code>BufferedReader reader;
  try { 
   URL url = new URL(URI);
   reader = new BufferedReader(new InputStreamReader(url.openStream())));
  } catch( MalformedURLException e ) { 
   throw new IOException("Expecting a well-formed URL: " + e); 
  }//end try: Have a stream
  
  String buffer;
  StringBuilder result = new StringBuilder();
  while( null != (buffer = reader.readLine()) ) { 
   result.append(buffer); 
  }//end while: Got the contents.
  reader.close();
  </code></pre>