title: Proxy error while accessing the application
body: <p>I have an apache proxy between browser and my custom web server. So after starting the webserver, I can access my web application for like 4-5 hours. After that I get this error </p>
  
  <blockquote>
    <p>Proxy Error The proxy server received an invalid response from an
    upstream server. The proxy server could not handle the request GET /.</p>
    
    <p>Reason: Error reading from remote server</p>
  </blockquote>
  
  <p>To access the web application again, I have to restart the web server. I tried to check the log I got from my web server and only error in that log , I am finding is this </p>
  
  <blockquote>
    <p>com.mysql.jdbc.CommunicationsException: Communications link failure
    due to underlying exception:</p>
    
    <p>** BEGIN NESTED EXCEPTION **</p>
    
    <p>java.net.SocketException MESSAGE: Connection timed out</p>
    
    <p>STACKTRACE:</p>
    
    <p>java.net.SocketException: Connection timed out
            at java.net.SocketInputStream.socketRead0(Native Method)
            at java.net.SocketInputStream.read(SocketInputStream.java:146)
            at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
            at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
            at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
            at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1910)
            at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
            at com.mysql.jdbc.Connection.execSQL(Connection.java:3170)
            at com.mysql.jdbc.Connection.execSQL(Connection.java:3099)
            at com.mysql.jdbc.Statement.execute(Statement.java:695)
            at hra.database.Pool.getConnection(Pool.java:62)       </p>
    
    <p>** END NESTED EXCEPTION **</p>
    
    <p>Last packet sent to the server was 925624 ms ago.</p>
  </blockquote>
  
  <p>And I tried to fix this database error, but I still get the above mentioned proxy error, so definitely the log information is not useful.</p>
  
  <p>This is what I am getting from Apache Proxy log </p>
  
  <blockquote>
    <p>(70007)The timeout specified has expired: proxy: error reading status
    line from remote server</p>
  </blockquote>
  
  <p>Does anyone know what can be the issue or any helpful pointers to fix this issue?</p>