It is late on a Friday afternoon, and your web application has stopped responding to requests. The server is still reachable, and the Apache Tomcat process is still running–there are no errors in the logs. You want to go home but you can’t until it is fixed. What do you do?
If your answer is “restart Tomcat and hope it stays up until Monday,” then this article is for you.
Rather than keeping your fingers crossed and hoping you don’t get an angry call from your boss over the weekend, this article will provide you with some simple steps you can take to diagnose the problem.
If the Tomcat process is running, then it must be doing something. The question is what is it doing when it should be responding to requests? The way to answer that question is with a thread dump–actually, a series of thread dumps. You need to take three thread dumps roughly 10 seconds apart and then compare them. I always compare them with a diff tool rather than by eye—a it is far too easy to miss subtle but important differences between the dumps.
How you generate a thread dump depends on your operating system and how you are running Tomcat. On Linux, FreeBSD, Solaris etc. use kill -3 to trigger a thread dump. On Windows use CTRL-BREAK if Tomcat is running in a console window. If Tomcat is running as a service, then the service wrapper should provide a way to trigger a thread dump. Commons Daemon (the service wrapper that ships with Tomcat) provides an option to trigger a thread dump via the system tray icon.
People are still discovering the benefits of the free tool from VMware SpringSource, called Spring Insight Developer. This post provides an explanation of what Spring Insight Developer does, how to set it up with Apache Tomcat, and an example of available plugins. For a better visual, there is also a video of the new Spring Insight 1.8.3 GUI embedded below.
Spring Insight is an extremely useful, time-saving, free tool for Spring developers and also has plugins for Grails, GemFire, Hadoop, Hibernate, JMS, JNDI, LDAP, MongoDB, RabbitMQ, Redis, Spring Batch, Spring Integration, Tomcat, and many more on Github. In the latest release of Spring Insight, VMware introduced a new "split-agent" architecture that will enable this tool to be extended to more runtime languages besides Java, such as .NET, Ruby, PHP, Python, etc. There is also a bounty program where you can get paid to develop new plugin or offer to pay others.
In a nutshell, Spring Insight Developer lets you see what your code is doing. When, as a developer, you press a button in your application’s GUI, you can see what Java code is invoked, how it translates into SQL, and quite a bit more. Before we show it in action, it’s worth mentioning a few of the benefits.
Let’s take a look at a simple example of tracing your app, viewing the details, and seeing the code in action.
For development and operations teams, a presentation to improve software development with Spring and Tomcat.
Spring is commonly found within enterprises and helps companies better manage complexities in the software development processTomcat has also become ubiquitous within the enterprise.
For development and operations teams, a presentation which outlines background of releases, new features of Tomcat 6, and more.
Since starting as a reference implementation by Sun Microsystems, Tomcat has undergone quite a history in the past 10 years with an average of one release per month. The history, versions, development lifecycle, and an in-depth look at key features in the new release are shared with other key insights on the new release and throughs on upgrading.
EMBEDDED PRESENTATION SLIDES (i.e. user can click “Next” thru slides)