Tomcat gives us a set of useful configuration properties that allow us to discover the root cause of an abandoned connection in two ways: logging the stack trace showing you the line of code that opened the connection receiving jmx notifications of abandoned connections. Each notification includes the time and the stack trace as in the log