Upgrading Apache Tomcat (Windows)

Published on
16,334 Points
Last Modified:
Upgrading Tomcat –
There are a couple of methods to upgrade Tomcat

is to use The Apache Installer
is to download and unzip and run the services.bat remove|install Tomcat6

Because of the App that we are working with, we can only use Tomcat 6.

Note: Care should be taken by the installer to address proper notification, testing and there could be variations to doing this process.

Why upgrade?  There can be many reasons and just to keep up-to-date is not always the best reason to do so.  However, reading the Apache Tomcat Change Log and the fact that there have been many releases since the version that I am going to show below which address memory, cpu and other components when running on the server.

From http://tomcat.apache.org/tomcat-6.0-doc/changelog.html we can find some compelling reasons as to why we are going to upgrade:
50306: New StuckThreadDetectionValve to detect requests that take a long time to process, which might indicate that their processing threads are stuck. Based on a patch provided by TomLu. (kkolinko)
Add denyStatus attribute to RequestFilterValve (RemoteAddrValve, RemoteHostValve valves). It allows to use different HTTP response code when rejecting denied request. E.g. 404 instead of 403. (kkolinko)
52850: Extend memory leak prevention and detection code to work with IBM as well as Oracle JVMs. Based on a patch provided by Rohit Kelapure. (kkolinko)
52858: Fix high CPU load with SSL, NIO and sendfile when client breaks the connection before reading all the requested data. (fhanik/kkolinko)
Which Version am I running?  Probably the easiest way to see the Apache Version is to open the Properties:Tomcat Version
Before we start... Backup, backup, backup..  Did I say backup?  Take the time to do this – it will save you heartburn and headaches later.

Go to the Java Tab Java Taband copy off the Java Options of the settings you may have made (paste into a notepad and save) – since this is not a tuning/tweaking tutorial, that is another discussion.

Copy the Tomcat folder as a copy of itself > e.g. D:\Tomcat6 as a copy into D:\Tomcat6-old
Note 1: Be sure you have enough free space on the drive – clear out logs and stuff as necessary
Note 2: If you do not want to see possible messages about in use files, stop the tomcat6 service first
Note 3: It is a poor practice to install Web Services on the same volume as your OS – that should be common knowledge.  I know, I know..  My screen pics show C:\tomcat6 in them..  I did not build out this server that I did this on..

Can’t I just take the installer (.exe) from tomcat.apache.org and install and upgrade?  Unfortunately, this is not the case as we will discover below.

Possible scenarios:
Trying to run the Apache Installer with the current Service up-and-running and going into the same folder:
Directory already existsClick OK
AbortYou will have to abort.. close Tomcat6w.exe by right-clicking on the app in the tray and choosing exitTrayScenario 2, let’s stop our monitors and stop the Apache Service:
Cannot installOK..  Let’s uninstall The Application – Add/remove or Programs and Features..
Remove confirmationStop here..  We are going to click No..  Otherwise, you will have to re-deploy war files, settings, etc. to your server.

Complete the uninstall..

Start the install of the new version of the software..
Install Over folderClick OK..

Awesome!  Service installs and completes..

Check http://localhost and Manager…
tomcat pageLet’s check a couple of other things:
Uh oh..No Db ConnectionSince I have done this before..  Copy sqljdbc4.jar from /tomcat6-old/lib to the /tomcat6/lib folder..
Copy /tomcat6-old/conf/server.xml to /tomcat6/conf/
Restart Apache Tomcat services and check connectivity again.
Wait for services to come back online..  Re-enable monitors..  We are done!!
Final version checkAfter the systems comes back online, watch the Tomcat install for memory and CPU usage.
Author:Kent Dyer
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 27

Expert Comment

just a remark, whenever I upgrade tomcat I always look for the latest java version.

so basically I stop tomcatm, save the webapps and config folder. deinstall tomcat, install latest (java6 or java7), install tomcat, copy the webapps and config folder to their former location.

I always make sure to copy the latest tcnative-1.dll file to the tomcat/bin folder. This is needed when you install tomcat on a server without access to the internet.

apart from that good article,

Expert Comment

by:Shashikanth P

I have upgrading Apache Tomcat 9.0.0.M3 to 9.0.0.M21 i.e latest version .

I am also getting the above  errors but i IGNORE the two steps but my tomcat has successfully upgraded .

Is there  any issue  in my up gradation process please let me know .

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Join & Write a Comment

This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month