Wednesday, April 23, 2008


Every organization have at least couple of old tomcat or java instance running but those version cannot be used for some new technology stuff like web services and you will find in situation to utilize same physical or virtual server to deploy your next state of art application which uses new version of tomcat and java.

Not sure about most of you but I found myself in above situation and decided to try out installing different version of java and tomcat on same machine.

I don't want to use java installer since it will modify my setting on windows server and I may end up fixing old app to work with new JRE.

Here is my existing configuration on windows box
Apache Tomcat/4.1.12-LE-jdk14
java 1.4.1_02-b06

and I want following to co-exists
Apache Tomcat/5.5.23
java 1.6.0_06-b02

Steps 1 & 2 are no brainer

  1. Copy java JRE folder(jre1.6.0_06) from different machine to target machine in x:\Program Files\Java
  2. Copy tomcat directory from machine where you may have already installed to target machine x:\Program Files\Apache Software Foundation\Tomcat 5.5
  3. Open server.xml from config folder and increment all port number by one

Tomcat 5.5 do not have catalina.bat or any other batch file where you can configure java path, latest releases of tomcat uses apache common demon called Procrun to start as service.

Execute following steps on the tomcat5.exe and tomact5W.exe in Bin folder

  1. Execute tomcat5.exe //IS// on command prompt - this will install windows service with name tomcat5.
  2. Execute tomcat5w.exe - this will launch configuration screen for tomcat5 service. Since we copied the tomcat application, most of the entries will be empty.

Fill in the following:

  1. Description: "Apache Tomcat 5.5.20 Server -"
  2. Log on if you want to start service with different credentials
  3. Log Path: "X:\Program Files\Apache Software Foundation\Tomcat 5.5\logs"
  4. Both redirect box to "Auto"
  5. For java JVM setting: Select new copied JVM
    "x:\Program Files\Java\jre1.6.0_06\bin\client\jvm.dll".
    Update Java-class path to
    "X:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar"

For Java option Add

-Dcatalina.home=X:\Program Files\Apache Software Foundation\Tomcat 5.5
-Dcatalina.base=X:\Program Files\Apache Software Foundation\Tomcat 5.5

-Djava.endorsed.dirs=X:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed\Program Files\Apache Software Foundation\Tomcat 5.5\temp
-Djava.util.logging.config.file=X:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\
-Xdebug-Xrunjdwp:transport=dt_socket,address=8000 ,server=y,suspen

Update memory pools as desired

For startup and shutdown, update class to "org.apache.catalina.startup.Bootstrap" and working Path to "x:\Program Files\Apache Software Foundation\Tomcat 5.5".

Select "JVM" in Mode option for startup and shutdown.

Update Argument with "start" and "stop" for tab startup and shutdown respectively.


If you are using Vista , make sure you start command line in Administrator mode

  1. At his moment you are all set , when you start the service , you may get JVM initialize error.

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

This error is cause by debug port conflict (due to other JVM running), which can be corrected by changing "address=8000" to "address=8001" in java option box.

Note: Procrun demon can be used to run any java application as windows services with no effort, Visit apache common demon called Procrun for more details.