title: The web application appears to have started a thread named but has failed to stop it. This is very likely to create a memory leak
body: <p>I am using hosebird client in java to get real time tweets using using twitter streaming api.</p>
  
  <p>After few hours while running it giving below exception.</p>
  
  <pre><code>18-Jul-2017 15:35:50.034 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [hosebird-client-io-thread-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
   java.net.SocketInputStream.socketRead0(Native Method)
   java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
   java.net.SocketInputStream.read(SocketInputStream.java:171)
   java.net.SocketInputStream.read(SocketInputStream.java:141)
   sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
   sun.security.ssl.InputRecord.read(InputRecord.java:503)
   sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
   sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
   sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
   org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
   org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
   org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
   org.apache.http.impl.conn.LoggingSessionInputBuffer.readLine(LoggingSessionInputBuffer.java:115)
   org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:251)
   org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:209)
   org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:171)
   org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:138)
   java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)
   java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
   java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
   com.twitter.hbc.common.DelimitedStreamReader.readLine(DelimitedStreamReader.java:72)
   com.twitter.hbc.common.DelimitedStreamReader.readLine(DelimitedStreamReader.java:56)
   com.twitter.hbc.core.processor.StringDelimitedProcessor.processNextMessage(StringDelimitedProcessor.java:53)
   com.twitter.hbc.core.processor.StringDelimitedProcessor.processNextMessage(StringDelimitedProcessor.java:26)
   com.twitter.hbc.core.processor.AbstractProcessor.process(AbstractProcessor.java:46)
   com.twitter.hbc.httpclient.Connection.processResponse(Connection.java:51)
   com.twitter.hbc.httpclient.ClientBase.processConnectionData(ClientBase.java:244)
   com.twitter.hbc.httpclient.ClientBase.run(ClientBase.java:144)
   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>I tried to change the hosebird-client-thread to daemon thread as mentioned  <a href="https://stackoverflow.com/questions/5905252/a-web-application-appears-to-have-started-a-thread-named-22-but-has-failed-to">here</a>, still no luck.</p>
  
  <pre><code>public static Thread getThreadByName(String threadName) {
      for (Thread t : Thread.getAllStackTraces().keySet()) {
          System.out.println("Thread is: "+ t.getName());
          if (t.getName().contains(threadName)) return t;
      }
      return null;
  }
  
  getThreadByName("hosebird-client-io-thread").setDaemon(true);
  </code></pre>
  
  <p>Any lead would greatly appreciated!</p>